mstar.communication.communicator#

Classes

BaseCommunicator()

CommProtocol(*values)

ZMQCommunicator(my_id, push_ids[, protocol, ...])

class mstar.communication.communicator.BaseCommunicator[source]#

Bases: ABC

abstractmethod get_all_new_messages()[source]#
Return type:

list

abstractmethod send(entity_id, msg)[source]#

entity_id: worker_xyz, conductor, or api_server

Parameters:

entity_id (str)

class mstar.communication.communicator.CommProtocol(*values)[source]#

Bases: Enum

IPC = 'IPC'#
RDMA = 'RDMA'#
SHM = 'SHM'#
TCP = 'TCP'#
class mstar.communication.communicator.ZMQCommunicator(my_id, push_ids, protocol=CommProtocol.IPC, ipc_socket_path_prefix='/tmp/mstar/')[source]#

Bases: BaseCommunicator

Parameters:
get_all_new_messages(blocking=False)[source]#
Return type:

list

push_sockets: dict[str, Socket[bytes]]#
register_event_for_poll(event)[source]#
Parameters:

event (EventWakeup)

send(entity_id, msg)[source]#

entity_id: worker_xyz, conductor, or api_server

Parameters:

entity_id (str)

wait_for_work(timeout_ms=50)[source]#