Streams for socket.io. Also works with mesh.
Basic example
var mesh = ;var loki = ;var io = ; var bus = mesh; // setup socket io - take all remote ops and pass// to the busvar iobus = mesh; // pipe all operations on bus to socket.io; // insert data into the DB. Should get broadcasted// to socket.io;
server configuration
Server configuration is pretty easy to setup. Just re-broadcast incomming operations.
var io = ;var server = ;server;
db(options, bus)
creates a new socket.io streamer.
options
host
- socket.io server hostchannel
- channel to subscribe to. Default isoperation
.
bus
- bus to pass remote calls to
var iodb =
stream.Readable db(operationName, options)
Broadcasts a new operation. This can be anything.
stream.Readable db(tail, filter)
Tails a remote operation.
// tail all operations; // tail only insert operations; // tail only operations on people collection;