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:
args – Command parameters as positional arguments
kwargs – Command parameters as keyword arguments
metadata (typing.Optional[typing.Iterable[ClientMetadataInstance]]) – SiLA Client Metadata to send along with the request
- 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 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)
- get_responses() ResponseType ¶
Request the command responses
- Returns:
responses – Command responses as named tuple
- Raises:
CommandExecutionNotFinished – If the command is still running
SilaError – If an error occurred during command execution
- 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