0.1.1 : Swarm architecture



A Swarm is a set of autonomous processes called Daemons that can exchange typed data with one another. The data exchanged can be of several kinds:
  • Raw data (RESULT_DATA): any serialisable C++ type pushed by one daemon to another for processing.
  • Control messages: STOP (graceful shutdown, allows the daemon to finish its current work), KILL (immediate shutdown), ADD_DAEMON / REMOVE_DAEMON (dynamic swarm topology updates).
  • Function calls (CALL_FUNCTION / RESULT_FUNCTION): remote procedure calls between daemons.
  • API discovery (API_DISCOVERY / API_DESCRIPTION): a daemon can query the list of data types and callable functions exposed by any other daemon of the swarm.
  • Confirmations (MESSAGE_CONFIRMATION): acknowledgements sent back to the originating daemon to confirm that a message was correctly received and processed.


Each Daemon is identified by a unique name, a hostname and a receiving port. A dedicated server socket (named pull) is opened on this port at startup. For each other daemon declared in the configuration, a client socket is opened, so that any daemon can push data to any other at any time.