diff --git a/lib/tfw/networking/server/event_handler_connector.py b/lib/tfw/networking/server/event_handler_connector.py index 5075c56..bc6c9be 100644 --- a/lib/tfw/networking/server/event_handler_connector.py +++ b/lib/tfw/networking/server/event_handler_connector.py @@ -21,6 +21,10 @@ class EventHandlerDownlinkConnector(ZMQConnectorBase): self._zmq_pull_socket.bind(address) LOG.debug('Pull socket bound to %s', address) + def register_callback(self, callback): + callback = with_deserialize_tfw_msg(callback) + self._zmq_pull_stream.on_recv(callback) + class EventHandlerUplinkConnector(ZMQConnectorBase): def __init__(self, zmq_context=None): @@ -30,11 +34,9 @@ class EventHandlerUplinkConnector(ZMQConnectorBase): self._zmq_pub_socket.bind(address) LOG.debug('Pub socket bound to %s', address) - -class EventHandlerConnector(EventHandlerDownlinkConnector, EventHandlerUplinkConnector): - def register_callback(self, callback): - callback = with_deserialize_tfw_msg(callback) - self._zmq_pull_stream.on_recv(callback) - def send_message(self, message: dict): self._zmq_pub_socket.send_multipart(serialize_tfw_msg(message)) + + +class EventHandlerConnector(EventHandlerDownlinkConnector, EventHandlerUplinkConnector): + pass