monitor
Monitor module and per-task context handling.
Module
Functions
task_config_update
def task_config_update( task_config: _JSONDict, privacy: MonitorRecordPrivacy = MonitorRecordPrivacy.OWNER_MODELLER,) ‑> None:
Send the final task config to the monitor service.
Arguments
task_config
: The task configuration as a JSON-compatible dictionary.privacy
: The privacy level of the update. Defaults to all participants.
task_monitor_context
def task_monitor_context( hub: BitfountHub, task_id: str, sender_id: str, recipient_id: Optional[str] = None,) ‑> Generator[None, None, None]:
Context manager that handles monitor module instance creation and removal.
Used to provide "task context" in which updates can be sent to the monitor service which are related to that task.
task_status_update
def task_status_update( message: str, privacy: MonitorRecordPrivacy = MonitorRecordPrivacy.ALL_PARTICIPANTS, metadata: Optional[_JSONDict] = None, progress: Optional[dict[str, ProgressCounterDict]] = None, resource_usage: Optional[dict[str, float]] = None,) ‑> None:
Send a task status update to the monitor service.
Arguments
message
: The update message to send.privacy
: The privacy level of the status update. Defaults to all participants.metadata
: Optional. Any metadata about the status update.progress
: Optional. Any progress counter information about the status update.resource_usage
: Optional. Any resource usage information about the status update.