Socket
Book a DemoInstallSign in
Socket

qb-messageq

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qb-messageq

MessageQ dialect for QB service framework

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

qb-messageq

messageq dialect for qb

Usage

messageq is a simple, reliable Redis-backed task queue based pub/sub messaging system based on relyq. It is based on a pub/sub model and an example follows.

npm install qb-messageq --save
qb.speaks(require('qb-messageq'), { port: 8000, base: '/qb-api' })
  .start()

  // Access a channel using messageq and qb's `contact` polymethod
  .contact('messageq://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('messageq://some-channel', 'some-channel')
  .contact('some-channel')
  // And lastly, you can publish on channels
  .publish({a: 'message', to: 'be', deliv:'ered'});

Options:

  • discovery_prefix: 'my-soa-discovery' (required) - Redis key prefix for the discovery service. This must be same across all messageq instances that want to talk to each other.
  • ttl: 5000 (default: 5s (in ms)) - Time to live between cached subscriber requests. Use a large one for long-term subscribers.

Note: The messageq dialect will use the same redis server as the qb framework for task queuing.

License

MIT in LICENSE file

Keywords

qb

FAQs

Package last updated on 30 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts