How to use the pm2-axon.RepSocket function in pm2-axon

To help you get started, we’ve selected a few pm2-axon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jitta / spinal / lib / broker.js View on Github external
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)

pm2-axon

High-level messaging & socket patterns implemented in pure js

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis