gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

MessageDispatcher

Class to dispatch messages to observers. It has a built in buffer to merge messages and dispatch them in a single call to the observers.

:return: description :rtype: type

Attributes
interval_time_dispatched_buffer: floatinterval_time_merging_message: floatmessage_level: MessageLevelprefix: str
Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

interval_time_merging_message : float - 0.1
interval_time_dispatched_buffer : int - 1
log_level : MessageLevel - INFO
prefix : str
parent_dispatcher : MessageDispatcher
attach

Attach the listener method and return an id to detach it later

observer : MessageObserver
attach_progress_bar

Attach a progress bar to update task messages when a message is sent. return an id to detach it later

progress_bar : ProgressBar
Return type : ProgressBarMessageObserver
create_sub_dispatcher

Create a sub dispatcher with the same configuration as the current dispatcher. The message will be forwarded to the parent dispatcher after prefix and log level modification. This is useful to override the prefix or the log level for a specific part of the code without affecting the parent dispatcher.

log_level : Optional
prefix : Optional
detach
observer : MessageObserver
force_dispatch_waiting_messages
has_observers
has_parent_dispatcher
Return type : bool
notify_debug_message

Trigger a debug in each subscriber.

message : str
notify_error_message

Trigger a error in each subscriber.

message : str
notify_info_message

Trigger an info in each subscriber.

message : str
notify_message

Trigger a message in each subscriber.

message : DispatchedMessage
notify_progress_value

Trigger an update in each subscriber.

progress : float
message : str
notify_success_message

Trigger a success in each subscriber.

message : str
notify_warning_message

Trigger a warning in each subscriber.

message : str