0.0.1 • Published 10 years ago

qb-nats v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
10 years ago

qb-nats

A pub/sub nats dialect for qb

Note: I suggest running the gnatsd server which is written in Go. I like Go better than ruby (also its probably faster).

Usage

npm install qb-nats --save
qb.speaks(require('qb-nats'), { nats: natsOptions })
  .start()

  // Access a channel using nats and qb's `contact` polymethod
  .contact('nats://new-users-channel')
    // Listen for messages on this channel
    .subscribe(function onNewUser(msg) {})
    // Or you can directly invoke a service queue
    .subscribe('service-to-execute-with-message');

// Or you can create an alias
qb.contacts('nats://some-channel', 'some-channel')
  .contact('some-channel')
  // And lastly, you can publish on channels
  .publish({a: 'message', to: 'be', deliv:'ered'});

Options:

See the node nats client for documentation on the nats options.

License

MIT in LICENSE file

0.0.1

10 years ago