Event: onRequest

This event is calling two times - when request data is preparing for send and after receiver cluster receives request from sender cluster.
Depends on these two situations an argument with situation context is passed.

In first situation, when request is preparing to be send, sender will call code below:

Request sender cluster:
/src/SkynetUser/MyListener.php
public function onRequest($context)
{
if($context == "beforeSend")
{
/* code executes in sender when request is preparing to be send */
}
}

Everything you will assign to request object above will be included in sended request.

In second situation, when request is received by cluster code below is executed:

Request receiver cluster:
/src/SkynetUser/MyListener.php
public function onRequest($context)
{
if($context == "afterReceive")
{
/* code executes in responder when responder gets request from sender */
}
}

In code above you have access to whole received request via:

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