0.5.2 • Published 9 years ago

statemon v0.5.2

Weekly downloads
41
License
-
Repository
-
Last release
9 years ago

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

{ Leaf } = require 'statemon'

new Leaf()
##################################################

The Hub

	hubConfig =
		secret: 'password'

	# These two examples are equivilent
	hub = statemon { hub: hubConfig }

	{ Hub } = statemon
	hub = new 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 }

	{ Leaf } = statemon
	leaf = new 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
0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago