Sleep and wakeup

Event Listener: Skynet\EventListener\SkynetEventListenerSleeper

Every cluster can be remotely "sleeped". Sleeped clusters are not broadcasting and they not generate responses.

If you want to sleep specified cluster, type in webconsole:

@sleep "CLUSTER_ADDRESS";

or

@sleep "CLUSTER_ADDRESS1", "CLUSTER_ADDRESS2", "CLUSTER_ADDRESS3"...;

If you want to sleep your own cluster, type:

@sleep me;

In Event Listener you will do it with:

/src/SkynetUser/MyListener.php:
public function onRequest($context)
{
if($context == "beforeSend")
{
$this->request->set('@sleep', '1');
}
}

Alternatively, you can sleep cluster via setting option sleep to value "1":

@opt_set sleep:"1";

In Event Listener (it will work only for THIS cluster):

/src/SkynetUser/MyListener.php:
public function onRequest($context)
{
if($context == "beforeSend")
{
$this->opt_set('sleep', 1);
}
}

When sleep, you can restore cluster by wake up it.
To wakeup cluster just use:

@wakeup "CLUSTER_ADDRESS";

or

@wakeup CLUSTER_ADDRESS1, CLUSTER_ADDRESS2, CLUSTER_ADDRESS3...;

to wakeup remote cluster.

OR:

@wakeup me;

if you want to wake up your own cluster.

Alternatively, you can wakeup cluster by setting option sleep to "0":

@opt_set sleep:"0";
Full API Documentation is included in Skynet packages available on GitHub.