Closed mavit closed 3 years ago
I simply hadn't given any thought to what would be required to support req
and res
, since I have no need for them myself.
But yes, it seems straightforward to support them too, so I've pushed a version that does.
Great, thanks!
Mojo::Transaction
has afinish
event which can be subscribed to to trigger a callback when the transaction completes. BecauseMojo::UserAgent::Cached
creates a new transaction containing the cached response, such a callback is only called when content is fetched, not when returned from cache.This commit fixes it so that the
finish
callback is called even for transactions returning cached responses.This seems to be sufficient for my use case (which is Mojo::UserAgent::Role::Queued). More work would be required to support other events, such as the
finish
events onreq
andres
.