dux-dispatcher-statestore-connection
Convenience wrapper for dispatcher connection and statestore api client
Last updated 5 years ago by asbjornenge .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dux-dispatcher-statestore-connection 
SYNC missed versions from official npm registry.

dux-dispatcher-statestore-connection

This is a convenience wrapper for dux-dispatcher-connection and dux-statestore-api-client keeping track of dispatcher connection state and querying the statestore for current value on initial connection(s). It simplifies building out dux services relying on statestore data.

Install

npm install dux-dispatcher-statestore-connection

Use

var ddsc = require('dux-dispatcher-statestore-connection')({
    dispatcher : {
        host : 'dux-dispatcher.dux.test',
        port : 8000
    },
    statestore : {
        host : 'dux-statestore.dux.test',
        port : 8000
    }
})
ddsc.on('/state/hosts', function() {
    // As soon as dispatcher is ready this function will be called with the current value in the statestore
    // .on also acts as a normal dispatcher subscription meaning this function will be called when the state value changes
})
ddsc.listen()

Changelog

1.0.0

  • Initial release :tada:

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

2 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2017 © taobao.org |