boss-local
A interface to an instance of boss running on the same host.
Usage
Local boss instance (e.g. on the same server). If the daemon cannot be reached it will be started.
N.b. the daemon will drop to the user account specified in the config file so please ensure you have sufficient privileges to do this.
var connect = connect config = boss: rundir: '/var/run/boss' logdir: '/var/log/boss' timeout: 10000 debug: daemon: false cluster: false
N.b. If you fail to close the connection to the daemon, your program will probably not exit.
Is Boss running?
Sometimes you don't want to start the daemon, you'd just like to know if boss is running on the current host or not.
var running = running config = boss: rundir: '/var/run/boss' logdir: '/var/log/boss' timeout: 10000 debug: daemon: false cluster: false
Logging
By default boss will log messages to the console. If you wish to pass these somewhere else (or ignore them entirely, pass an additional object in to the connect function with four properties - info
, warn
, error
, debug
.
var connect = connect config = boss: rundir: '/var/run/boss' logdir: '/var/log/boss' timeout: 10000 debug: daemon: false cluster: false logger = {} {} {} {}
If you are making lots of connections, for convenience you may wish to bind these arguments to the function:
var connect = connect connect = connect