client icon indicating copy to clipboard operation
client copied to clipboard

Adds RequestHandled event

Open gehrisandro opened this issue 2 years ago • 2 comments

This PR adds the ability register an event dispatcher.

When a request has been handled successfully and an event dispatcher is registered, a RequestHandled event will be dispatched. The event contains the initial Payload of the request and the Response.

This feature is required to create a Recorder for Laravel Pulse in the openai/laravel repository.

Todos:

  • [x] Find a better name for the Transportable contract
  • [ ] Add events docs
  • [ ] Add missing factory tests

gehrisandro avatar Dec 05 '23 08:12 gehrisandro

Besides the Laravel Pulse use-case, we got some people asking to instrument this library in our Sentry Laravel SDK. Is there any appetite to move forward with this PR?

cleptric avatar Jun 14 '24 14:06 cleptric