baseimage-tutorial-framework/lib/tfw/builtins/tfw_server_connector.py

20 lines
485 B
Python
Raw Normal View History

from functools import partial
from tfw.networking import ServerUplinkConnector, ServerConnector
from tfw.config import TFWENV
UPLINK_CONN_ADDR = f'tcp://localhost:{TFWENV.PULL_PORT}'
DOWNLINK_CONN_ADDR = f'tcp://localhost:{TFWENV.PUB_PORT}'
TFWServerUplinkConnector = partial(
ServerUplinkConnector,
connect_addr=UPLINK_CONN_ADDR
)
TFWServerConnector = partial(
ServerConnector,
downlink_connect_addr=DOWNLINK_CONN_ADDR,
uplink_connect_addr=UPLINK_CONN_ADDR
)