Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Broker = function(options){
var that = this
this.id = puid.generate()
this.rep = new axon.RepSocket
this.server = new rpc.Server(this.rep)
this.options = options || {}
this.redis = null
this.redis_prefix = this.options.redis_prefix || 'spinal:'
this.queue = null
if(this.options.redis){
this.redis = new Redis(this.options.redis)
debug('[redis] initialize')
var Queue = require('./queue')
this.queue = new Queue(this, {redis: this.options.redis})
}
this.router = new Router(this, {
redis: this.redis,
redis_prefix: this.redis_prefix || 'spinal:'
})
this.metrics = (require('./metrics'))(this, this.options)