broker

Broker publish and subscription sensor events.

Methods

attach(socket) static

Attach a socket that listens to all events
Arguments:
  1. socket (Object)  Socket

create(sensorName) → function static

Arguments:
  1. sensorName (String)

destroy(sensorName) static

Remove publish function.
Arguments:
  1. sensorName (String)

detach(c) static

Remove a previously attached socket
Arguments:
  1. c (Object)  Client

subscribe(sensorName, cb) static

Pass in a function to call when a sensor event fires.
Arguments:
  1. sensorName (String)
  2. cb (function)  Publish callback

unSubscribe(listener) static

Stop subscribing to a sensor
Arguments:
  1. listener (*)