Coordinator

Coordinator among channels.

ehforwarderbot.coordinator.profile

Name of current profile..

Type:str
ehforwarderbot.coordinator.mutex

Global interaction thread lock.

Type:threading.Lock
ehforwarderbot.coordinator.master

The running master channel object.

Type:EFBChannel
ehforwarderbot.coordinator.slaves

Dictionary of running slave channel object. Keys are the unique identifier of the channel.

Type:Dict[str, EFBChannel]
ehforwarderbot.coordinator.middlewares

List of middlewares

Type:List[EFBMiddleware]
ehforwarderbot.coordinator.add_channel(channel: ehforwarderbot.channel.EFBChannel)[source]

Register the channel with the coordinator.

Parameters:channel (EFBChannel) – Channel to register
ehforwarderbot.coordinator.add_middleware(middleware: ehforwarderbot.middleware.EFBMiddleware)[source]

Register a middleware with the coordinator.

Parameters:middleware (EFBMiddleware) – Middleware to register
ehforwarderbot.coordinator.master = None

The instance of the master channel.

ehforwarderbot.coordinator.master_thread = None

The thread running poll() of the master channel.

ehforwarderbot.coordinator.middlewares = []

Instances of middlewares. Sorted in the order of execution.

ehforwarderbot.coordinator.mutex = <unlocked _thread.lock object>

Mutual exclusive lock for user interaction through CLI interface

ehforwarderbot.coordinator.profile = 'default'

Current running profile name

ehforwarderbot.coordinator.send_message(msg: ehforwarderbot.message.EFBMsg) → Optional[ehforwarderbot.message.EFBMsg][source]

Deliver a message to the destination channel.

Parameters:msg (EFBMsg) – The message
Returns:The message sent by the destination channel, includes the updated message ID from there. Returns None if the message is not sent.
ehforwarderbot.coordinator.send_status(status: ehforwarderbot.status.EFBStatus)[source]

Deliver a message to the destination channel.

Parameters:status (EFBStatus) – The status
ehforwarderbot.coordinator.slave_threads = {}

Threads running poll() from slave channels. Keys are the channel IDs.

ehforwarderbot.coordinator.slaves = {}

Instances of slave channels. Keys are the channel IDs.

ehforwarderbot.coordinator.translator = None

Internal GNU gettext translator.