Beispiel #1
0
    def __init__(self):
        """
        Constructor.

        Create ZeroMQ context.
        """
        self.connections = set()
        self.context = Context(self.ioThreads)
Beispiel #2
0
    def __init__(self, io_threads=1):
        """
        @param io_threads; Passed through to zmq.core.context.Context
        """
        global _context

        assert _context is None, 'Only one ZmqContext instance is permitted'

        self._sockets = set()
        self._zctx = Context(io_threads)

        _context = self

        reactor.addSystemEventTrigger('during', 'shutdown', _cleanup)