0.1.1.3 : Backend abstraction
PhoenixSwarm abstracts two orthogonal concerns behind a backend mechanism, so that developers can choose the most appropriate technology for their deployment environment:
- Socket backend: handles all inter-Daemon communication. Supported backends include Unix Socket, ZMQ, NetMQ, RabbitMQ, and any custom implementation. The socket backend governs send/receive flags (blocking or non-blocking) and associated timeouts.
- Clock backend: provides timestamps used to compute inter-Daemon latencies and to drive the statistics timer. The default backend (PClockNsBackend) offers nanosecond precision and can run for approximately 60 years.
Both backends support three operating modes:
- Normal mode (NO_MOCK): the official production backend is used as-is.
- Mock mode (MOCK): a pre-recorded sequence of socket exchanges and clock values is replayed. This allows full unit testing of daemon workflows without any real network infrastructure and without timing side-effects.
- Record mode (MOCK_RECORD): the official backend runs normally, but all socket and clock calls are recorded to disk so they can be replayed later in mock mode.