pyrtma.client.client_context
- client_context(module_id=0, server_name='localhost:7111', msg_list=None, host_id=0, timecode=False, logger_status=False, daemon_status=False)[source]
Context manager function to simplify initializing a pyrtma Client
Context manager will yield a Client object after connecting to message manager, optionally subscribing to msg_list, and after calling send_module_ready(). Client will disconnect when exiting context.
- Parameters:
module_id (optional) – Static module ID, which must be unique. Defaults to 0, which generates a dynamic module ID.
server_name (optional) – IP_addr:port_num string associated with message manager. Defaults to “localhost:7111”.
msg_list (optional) – A list of numeric message IDs to subscribe to
host_id (optional) – Host ID. Defaults to 0.
timecode (optional) – Add additional timecode fields to message header, used by some projects at RNEL. Defaults to False.
logger_status (optional) – Flag to declare client as a logger module. Logger modules are automatically subscribed to all message types. Defaults to False.
daemon_status (optional) – Flag to declare client as a daemon. Defaults to False.
- Yields:
Client – initialized pyrtma Client object