StateMon
Facilitates cross server socket.io-client
connections for the purpose of syncing stdout
, stderr
, latency, probing server frontends and of course sharing state.
One Hub, many Leafs. Leafs connect to the Hub.
Examples
require 'statemon' ##################################################
The Hub
hubConfig = secret: 'password' # These two examples are equivilent hub = statemon hub: hubConfig statemon hub = hubConfig
hub = server: SocketIo Server# Emits events from Leafs
The hub should normally only exist once.
The Leaf
leafConfig = secret : 'password' host : 'http://someplace.com:1337' name : 'Server 2' # These two examples are equivilent leaf = statemon leaf: leafConfig statemon leaf = leafConfig
leaf: socket : SocketIoClient Socket# Emits events from the Hub ### Modifiable listeners for Hub events, each bound to the leaf instance with .bind() Modify this only BEFORE .listen() is called to overwrite default listeners. ### listeners :
Leafs exist on seperate processes/servers to other leafs/the hub. Leafs communicate with only the hub, and the hub to them.
TODO
- Need to flesh out commands for leafs.
- Hub LeafSession event listener flexibility/flesh out and documentation