Skip to content

Commit

Permalink
Merge pull request #23 from quadland/UpdateEventsDocumentation
Browse files Browse the repository at this point in the history
Update events documentation
  • Loading branch information
Florian Preusner committed Sep 22, 2015
2 parents e3c9a1b + f3d2142 commit 47ae444
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ $response = $client->get('/users');
## Events
Handling events. Events are dispatched before and after the request to the remote host.
### Listening To Events
``` xml
<service id="listenerID" class="Your\ListenerClass\That\Implements\GuzzleEventListenerInterface">
<tag name="kernel.event_listener" event="guzzle_bundle.pre_transaction" method="onPreTransaction" service="servicename"/>
</service>
```xml
<service id="listenerID" class="Your\ListenerClass\That\Implements\GuzzleEventListenerInterface">
<tag name="kernel.event_listener" event="guzzle_bundle.pre_transaction" method="onPreTransaction" service="servicename"/>
</service>
```

Your event Listener, or Subscriber **MUST** implement GuzzleBundle\Events\GuzzleEventListenerInterface.
Events dispatched are guzzle_bundle.pre_transaction, guzzle_bundle.post_transaction.
The service on the tag, is so that if you have multiple REST endpoints you can define which service a particular listener is interested in.

## Features
### Symfony Debug Toolbar / Profiler
<img src="/Resources/doc/img/debug_logs.png" alt="Debug Logs" title="Symfony Debug Toolbar - Guzzle Logs" style="width: 360px" />
Expand Down

0 comments on commit 47ae444

Please sign in to comment.