Koordinatör

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

Channel

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[Middleware]

ehforwarderbot.coordinator.add_channel(channel)[kaynak]

Register the channel with the coordinator.

Parametreler

channel (Channel) – Channel to register

ehforwarderbot.coordinator.add_middleware(middleware)[kaynak]

Register a middleware with the coordinator.

Parametreler

middleware (Middleware) – Middleware to register

ehforwarderbot.coordinator.get_module_by_id(module_id)[kaynak]

Return the module instance of a provided module ID

Parametreler

module_id (NewType()(ModuleID, str)) – Module ID, with instance ID if available.

Dönüş türü

Union[Channel, Middleware]

Dönüşler

Module instance requested.

Harekete geçirir

NameError – When the module is not found.

ehforwarderbot.coordinator.master: ehforwarderbot.channel.MasterChannel

The instance of the master channel.

ehforwarderbot.coordinator.master_thread: Optional[threading.Thread] = None

The thread running poll() of the master channel.

ehforwarderbot.coordinator.middlewares: List[ehforwarderbot.middleware.Middleware] = []

Instances of middlewares. Sorted in the order of execution.

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

Mutual exclusive lock for user interaction through CLI interface

ehforwarderbot.coordinator.profile: str = 'default'

Current running profile name

ehforwarderbot.coordinator.send_message(msg)[kaynak]

Deliver a new message or edited message to the destination channel.

Parametreler

msg (Message) – The message

Dönüş türü

Optional[Message]

Dönüşler

The message processed and delivered by the destination channel, includes the updated message ID if sent to a slave channel. Returns None if the message is not sent.

ehforwarderbot.coordinator.send_status(status)[kaynak]

Deliver a status to the destination channel.

Parametreler

status (Status) – The status

ehforwarderbot.coordinator.slave_threads: Dict[ModuleID, threading.Thread] = {}

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

ehforwarderbot.coordinator.slaves: Dict[ModuleID, ehforwarderbot.channel.SlaveChannel] = {}

Instances of slave channels. Keys are the channel IDs.

ehforwarderbot.coordinator.translator: gettext.NullTranslations = <gettext.NullTranslations object>

Internal GNU gettext translator.