StatusMessageWatcherAsync
Hierarchy
- StatusMessageWatcherBase
- StatusMessageWatcherAsync
Index
Methods
__aenter__
Start the logging task within the context. Exiting the context will cancel the logging task.
Returns Self
__aexit__
Cancel the logging task.
Parameters
exc_type: type[BaseException] | None
exc_val: BaseException | None
exc_tb: TracebackType | None
Returns None
__init__
Initialize
StatusMessageWatcherAsync.Parameters
keyword-onlyrun_client: RunClientAsync
The run client used to poll the Actor run status and status message.
keyword-onlyto_logger: logging.Logger
The logger to which the status messages will be forwarded.
optionalkeyword-onlycheck_period: timedelta = timedelta(seconds=1)
How often to poll the status message.
Returns None
start
Start the polling task.
The caller is responsible for cleanup by calling the
stopmethod when done.Returns Task
stop
Stop the logging task.
Returns None
Polls and logs Actor run status messages in an asyncio task.
The status message and status of the Actor run are polled at a fixed interval and forwarded to the provided logger whenever they change. There is no guarantee that every intermediate status message will be captured, especially when messages change rapidly.
Can be used as an async context manager, which automatically starts and cancels the polling task. Alternatively, call
startandstopmanually. Obtain an instance viaRunClientAsync.get_status_message_watcher.