Connection Modes

By default, when Skynet object is started with parameter "true" then Skynet starts in broadcast mode.
Skynet has 3 different modes:

1) Idle
When idle mode is set then Skynet not sends any data and there is no connections creates to another clusters.
You can set "Idle mode" by clicking on "Idle" button at the top of clusters list window, below the Skynet's logo.
When you will send command in idle then no connection will be executed (expects @connect command).

2) Single
When you are connecting to specified cluster address then Skynet will be connect only to it and there will be no connections to others clusters.
Every data sended in this mode will be send only to specified cluster. If there will be an error with connection then Skynet will change its mode to "Idle".

3) Broadcast
In "broadcast" mode every commands and parameters are sended to ALL clusters stored in database.
Status of every connection is shown by colour icon on clusters list. When connection is succesful and response data is received then green icon will be shown.
If any connection error will occur then icon will change colour to red. If there is no connection with specified clusters then icon will be in grey colour and "Ping" value will be set to "0".
Most od Skynet commands can works in different modes:

- me - command is executes only on your cluster, e.g.:

@sleep me

will sleep only your cluster and data will not send to others clusters.

@sleep "all"

will send @sleep command to all clusters stored in database.

@sleep "address"

will send @sleep command only to cluster with "address" address.

When you sending parameters without addresses specified, then paremeters will be send to all clusters in broadcast mode, e.g.:

foo:"bar"

will send parameter foo with value bar to all cluster stored in database when you are in broadcast mode.

When Skynet connects with another cluster then stored in database clusters list is attached to request - if connected cluster has no any cluster sended in request then its clusters list will be updated with new one.
In second way - when respone has clusters in its list whitch you not have in databae then your clusters list will be updated with new one.

You can "exit" from broadcast mode when sending parameters by setting "@to" command:

foo:"bar";
@to "address";

When Skynet is connected to other cluster then "favicon" of Control Panel is set to green.

Default mode you can set in config file by changing option:

$config['core_mode']

Possible values:

- 0 - Idle
- 1 - Single
- 2 - Broadcast
Full API Documentation is included in Skynet packages available on GitHub.