MAKS\AmqpAgent\RPC\AbstractEndpoint::on

Hooking method based on events to manipulate the request/response during the endpoint/message life cycle.

Check out `self::$events` via `self::getEvents()` after processing at least one request/response to see all available events. The parameters will be passed to the callback as follows: 1. `$listenedOnObject` (first segment of event name e.g. `'connection.after.open'` will be `$connection`), 2. `$calledOnObject` (the object this method was called on e.g. `$endpoint`), 3. `$eventName` (the event was listened on e.g. `'connection.after.open'`). ``` $endpoint->on('connection.after.open', function ($connection, $endpoint, $event) { ... }); ```