mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-14 03:27:18 +00:00
Improve ZMQ port envvar names
This commit is contained in:
parent
e44a99fa6d
commit
f151ecfbac
@ -23,8 +23,8 @@ ENV TFW_PUBLIC_PORT=8888 \
|
|||||||
TFW_LOGIN_APP_PORT=6666 \
|
TFW_LOGIN_APP_PORT=6666 \
|
||||||
TFW_TERMINADO_PORT=7878 \
|
TFW_TERMINADO_PORT=7878 \
|
||||||
TFW_SUPERVISOR_HTTP_PORT=9001 \
|
TFW_SUPERVISOR_HTTP_PORT=9001 \
|
||||||
TFW_PUBLISHER_PORT=7654 \
|
TFW_PUB_PORT=7654 \
|
||||||
TFW_RECEIVER_PORT=8765
|
TFW_PULL_PORT=8765
|
||||||
|
|
||||||
EXPOSE ${TFW_PUBLIC_PORT}
|
EXPOSE ${TFW_PUBLIC_PORT}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class EventHandlerDownlinkConnector():
|
|||||||
self._zmq_pull_socket = zmq.Context.instance().socket(zmq.PULL)
|
self._zmq_pull_socket = zmq.Context.instance().socket(zmq.PULL)
|
||||||
self._zmq_pull_socket.setsockopt(zmq.RCVHWM, 0)
|
self._zmq_pull_socket.setsockopt(zmq.RCVHWM, 0)
|
||||||
self._zmq_pull_stream = ZMQStream(self._zmq_pull_socket)
|
self._zmq_pull_stream = ZMQStream(self._zmq_pull_socket)
|
||||||
address = f'tcp://*:{TFWENV.RECEIVER_PORT}'
|
address = f'tcp://*:{TFWENV.PULL_PORT}'
|
||||||
self._zmq_pull_socket.bind(address)
|
self._zmq_pull_socket.bind(address)
|
||||||
LOG.debug('Pull socket bound to %s', address)
|
LOG.debug('Pull socket bound to %s', address)
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class EventHandlerUplinkConnector():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._zmq_pub_socket = zmq.Context.instance().socket(zmq.PUB)
|
self._zmq_pub_socket = zmq.Context.instance().socket(zmq.PUB)
|
||||||
self._zmq_pub_socket.setsockopt(zmq.SNDHWM, 0)
|
self._zmq_pub_socket.setsockopt(zmq.SNDHWM, 0)
|
||||||
address = f'tcp://*:{TFWENV.PUBLISHER_PORT}'
|
address = f'tcp://*:{TFWENV.PUB_PORT}'
|
||||||
self._zmq_pub_socket.bind(address)
|
self._zmq_pub_socket.bind(address)
|
||||||
LOG.debug('Pub socket bound to %s', address)
|
LOG.debug('Pub socket bound to %s', address)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__)
|
|||||||
class ServerDownlinkConnector():
|
class ServerDownlinkConnector():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._zmq_sub_socket = zmq.Context.instance().socket(zmq.SUB)
|
self._zmq_sub_socket = zmq.Context.instance().socket(zmq.SUB)
|
||||||
self._zmq_sub_socket.connect(f'tcp://localhost:{TFWENV.PUBLISHER_PORT}')
|
self._zmq_sub_socket.connect(f'tcp://localhost:{TFWENV.PUB_PORT}')
|
||||||
self._zmq_sub_socket.setsockopt(zmq.RCVHWM, 0)
|
self._zmq_sub_socket.setsockopt(zmq.RCVHWM, 0)
|
||||||
self._zmq_sub_stream = ZMQStream(self._zmq_sub_socket)
|
self._zmq_sub_stream = ZMQStream(self._zmq_sub_socket)
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class ServerDownlinkConnector():
|
|||||||
class ServerUplinkConnector():
|
class ServerUplinkConnector():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._zmq_push_socket = zmq.Context.instance().socket(zmq.PUSH)
|
self._zmq_push_socket = zmq.Context.instance().socket(zmq.PUSH)
|
||||||
self._zmq_push_socket.connect(f'tcp://localhost:{TFWENV.RECEIVER_PORT}')
|
self._zmq_push_socket.connect(f'tcp://localhost:{TFWENV.PULL_PORT}')
|
||||||
self._zmq_push_socket.setsockopt(zmq.SNDHWM, 0)
|
self._zmq_push_socket.setsockopt(zmq.SNDHWM, 0)
|
||||||
|
|
||||||
def send_message(self, message, scope=Scope.ZMQ):
|
def send_message(self, message, scope=Scope.ZMQ):
|
||||||
|
Loading…
Reference in New Issue
Block a user