###β Bilanx
β Bilanx, a fast and simplified command queue for 🂢 Deuces, a minimal Redis client. It is custom version of the ♎ Libra module, it handles only some commands, primarily pubsub ones and monitor.
It implements an automatic rollback mechanism for subscriptions, when the connection is lost.
It is heavily based on Train module, a well-tested and fast FIFO queue.
###Install
$ npm install bilanx [-g]
// clone repo
$ git clone git@github.com:rootslab/bilanx.git
install and update devDependencies:
$ cd bilanx/
$ npm install --dev
$ npm update --dev
require
var Bilanx = require( 'bilanx' );
See examples.
###Run Tests
$ cd bilanx/
$ npm test
###Run Benchmark
$ cd bilanx/
$ npm run bench
NOTE: You should install devDependencies (Syllabus) for running benchmarks.
###Constructor
Create an instance, argument within [ ] is optional.
var l = Bilanx( [ opt ] )
var l = new Bilanx( [ opt ] )
####Options
Default options are listed.
opt = {
rollback : 64 * 1024
, timestamps : false
}
Properties
WARNING: Don't mess with these properties.
Bilanx.cqueue : Train
Bilanx.status : {
subscription : {
on : 0
, active : 0
, channels : 0
, patterns : 0
, last_update : -1
}
, monitoring : {
on : 0
, active : 0
, last_update : -1
}
, auth : []
}
###Methods
Arguments within [ ] are optional.
Bilanx#auth( Object syllabus_auth_command ) : Object
Bilanx#update( subscription_command_reply [, channels_number ] ) : Number
Bilanx#subs() : Bilanx
Bilanx#push( Object syllabus_command ) : Number
Bilanx#pop() : Object
Bilanx#head( [ Number pos ] ) : Object
Bilanx#rollUp( [ Boolean on ] ) : Bilanx
Bilanx#rollBack( [ Boolean on ] ) : Bilanx
Bilanx#iterate( Function fn [, Object scope [, Function cback [, Boolean evict ] ] ] ) : Bilanx
Bilanx#flush() : Bilanx
Bilanx#reset() : Bilanx
MIT License
Copyright (c) 2014 < Guglielmo Ferri : 44gatti@gmail.com >
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.