Class ClientObservableCommand

class sila2.client.ClientObservableCommand(parent_feature: ClientFeature, wrapped_command: ObservableCommand)

Wraps an observable command

__call__(*args, **kwargs) ClientObservableCommandInstance

Request execution of the observable command

Parameters:
Returns:

instance – Instance of the command execution

Class ClientObservableCommandInstance

class sila2.client.ClientObservableCommandInstance(parent_client: SilaClient, client_command: ClientObservableCommand, execution_uuid: UUID, lifetime_of_execution: timedelta | None = None)

Represents the execution of an observable command

property execution_uuid: UUID

Execution UUID of the represented command instance.

property lifetime_of_execution: timedelta | None

Duration until the SiLA Server is allowed to forget about this command execution (None: infinite lifetime)

property estimated_remaining_time: timedelta | None

Estimated remaining time (None if the SiLA Server has not provided this information)

property status: CommandExecutionStatus | None

Execution status (None if the SiLA Server has not provided this information)

property progress: float | None

Progress in percent (None if the SiLA Server has not provided this information)

property done: bool

True if status is either finishedSuccessfully or finishedWithError

get_responses() ResponseType

Request the command responses

Returns:

responses – Command responses as named tuple

Raises:
cancel_execution_info_subscription() None

Cancel the subscription to execution information.

This instance will no longer listen for updates to the command execution status, progress, or estimated remaining time.

class sila2.client.ClientObservableCommandInstanceWithIntermediateResponses(parent_client: SilaClient, client_command: ClientObservableCommand, execution_uuid: UUID, lifetime_of_execution: timedelta | None = None)

Bases: ClientObservableCommandInstance[ResponseType]

subscribe_to_intermediate_responses() Subscription[IntermediateResponseType]

Subscribe to intermediate responses

Returns:

intermediate_response_subscription – Subscription to the intermediate responses

get_intermediate_response() IntermediateResponseType

Request the current intermediate response item

Returns:

intermediate_response (NamedTuple) – The current intermediate response

Notes

This is equivalent to subscribing to intermediate response and cancelling the subscription after receiving the first item