Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pass
@abstractmethod
def stop(self):
pass
@abstractmethod
def _on_recv_frontend(self, stream, msg):
pass
@abstractmethod
def _on_recv_backend(self, stream, msg):
pass
class CommandHandler(Handler):
def __init__(self, name, frontend_point, backend_point, context = None, loop = None):
Handler.__init__(self, name, frontend_point, backend_point, context, loop)
self._frontend = self._context.socket(zmq.ROUTER)
self._frontend.setsockopt(zmq.IDENTITY,'FRONTEND-{0}'.format( self._name))
self._backend = self._context.socket(zmq.DEALER)
self._backend.setsockopt(zmq.IDENTITY,'BACKEND-{0}'.format( self._name))
self._stream_frontend = zmqstream.ZMQStream(self._frontend)
self._stream_frontend.on_recv_stream(self._on_recv_frontend)
self._stream_backend = zmqstream.ZMQStream(self._backend)
self._stream_backend.on_recv_stream(self._on_recv_backend)