Event: onResponse

Similary to onRequest event, this event is calling also two times - when response data is preparing and after sender cluster receives response to request.
Depends on these two situations an argument with context is passed.

In first situation, when response is preparing to be send, request receiver will call code below:
/src/SkynetUser/MyListener.php
public function onResponse($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 second situation, when response is received by sender cluster code below is executed:
/src/SkynetUser/MyListener.php
public function onResponse($context)
{
if($context == "afterReceive")
{
/* code executes in sender when sender receives response */
}
}

In code above you are have access to whole received response via:

$this->response
Full API Documentation is included in Skynet packages available on GitHub.