How to use the zeromq.Context function in zeromq

To help you get started, we’ve selected a few zeromq 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 sfast / zeronode / src / sockets / example / bug.js View on Github external
import zmq from 'zeromq'

zmq.Context.setMaxThreads(8)

let getMaxThreads = zmq.Context.getMaxThreads()
let getMaxSockets = zmq.Context.getMaxSockets()

console.log('getMaxThreads', getMaxThreads)
console.log('getMaxSockets', getMaxSockets)

let dealer1 = zmq.socket('dealer')
let dealer2 = zmq.socket('dealer')

let router1 = zmq.socket('router')
let router2 = zmq.socket('router')

// ** BUG scenario
// router1.monitor(10, 0)
// router2.monitor(10, 0)
// dealer1.monitor(10, 0)
// dealer2.monitor(10, 0)
github sfast / zeronode / src / sockets / example / bug.js View on Github external
import zmq from 'zeromq'

zmq.Context.setMaxThreads(8)

let getMaxThreads = zmq.Context.getMaxThreads()
let getMaxSockets = zmq.Context.getMaxSockets()

console.log('getMaxThreads', getMaxThreads)
console.log('getMaxSockets', getMaxSockets)

let dealer1 = zmq.socket('dealer')
let dealer2 = zmq.socket('dealer')

let router1 = zmq.socket('router')
let router2 = zmq.socket('router')

// ** BUG scenario
// router1.monitor(10, 0)
// router2.monitor(10, 0)