Event: onBroadcast

Event is calling two times - when response data is preparing for send and after sender cluster receives response.
Depends on these two situations an argument with context is passed.

In first situation, when response is preparing to be send, receiver will call code below:
/src/SkynetUser/MyListener.php
public function onBroadcast($context)
{
if($context == "beforeSend")
{
/* code executes in responder when response is preparing to be send */
}
}

Everything you assign to response object above will be included in sended response.
In extended broadcast mode also request will be included to response here.

In second situation, when response is received by sender code below is executed:
/src/SkynetUser/MyListener.php
public function onBroadcast($context)
{
if($context == "afterReceive")
{
/* code executes in sender when sender receives response */
}
}

In code above you have access to whole received response via:
$this->response
Full API Documentation is included in Skynet packages available on GitHub.