Class ObservableCommandInstance

class sila2.server.ObservableCommandInstance(execution_uuid: UUID, execution_info_queue: Queue[CommandExecutionInfo], logger: logging.Logger, lifetime_of_execution: timedelta | None)

Instance of a currently running observable command. Provides means to update the execution information.

begin_execution() None

Observable commands start with the status waiting. Use this method to set the status to running. This is done automatically if the progress is set to a number greater than 0.

property execution_uuid: UUID

Command Execution UUID of this command execution instance.

property progress: float | None

Command execution progress. Must be None, or a number between 0 and 1. Clients are notified about updates.

property estimated_remaining_time: timedelta | None

Command execution progress. Must be None, or a positive timedelta. Clients are notified about updates.

property lifetime_of_execution: timedelta | None

Lifetime of the command execution. Must be None, or a positive timedelta. Clients are notified about updates.

Class ObservableCommandInstanceWithIntermediateResponses

class sila2.server.ObservableCommandInstanceWithIntermediateResponses(execution_uuid: UUID, execution_info_queue: Queue[CommandExecutionInfo], intermediate_response_queue: Queue[IntermediateResponseType], logger: logging.Logger, lifetime_of_execution: timedelta | None)

Instance of a currently running observable command. Provides means to update the execution information and send intermediate responses.

begin_execution() None

Observable commands start with the status waiting. Use this method to set the status to running. This is done automatically if the progress is set to a number greater than 0.

property estimated_remaining_time: timedelta | None

Command execution progress. Must be None, or a positive timedelta. Clients are notified about updates.

property execution_uuid: UUID

Command Execution UUID of this command execution instance.

property lifetime_of_execution: timedelta | None

Lifetime of the command execution. Must be None, or a positive timedelta. Clients are notified about updates.

property progress: float | None

Command execution progress. Must be None, or a number between 0 and 1. Clients are notified about updates.

send_intermediate_response(value: IntermediateResponseType) None

Send intermediate responses to subscribing clients

Parameters:

value – The intermediate responses to send