Share via


AsyncPollingMethod Class

ABC class for polling method.

Constructor

AsyncPollingMethod()

Methods

finished

Check if the polling operation is finished.

from_continuation_token

Create a poller from a continuation token.

get_continuation_token

Return a continuation token that allows to restart the poller later.

initialize

Initialize the polling method with the client, initial response, and deserialization callback.

resource

Return the resource of the long running operation.

run

Run the polling method. This method should be overridden to implement the polling logic.

status

Return the current status of the polling operation.

finished

Check if the polling operation is finished.

finished() -> bool

Returns

Type Description

True if the polling operation is finished, False otherwise.

from_continuation_token

Create a poller from a continuation token.

from_continuation_token(continuation_token: str, **kwargs: Any) -> Tuple[Any, Any, Any]

Parameters

Name Description
continuation_token
Required
str

An opaque continuation token

Returns

Type Description
Tuple[Any, Any, <xref:DeserializationCallbackType>]

A tuple containing the client, initial response, and deserialization callback.

get_continuation_token

Return a continuation token that allows to restart the poller later.

get_continuation_token() -> str

Returns

Type Description
str

An opaque continuation token

initialize

Initialize the polling method with the client, initial response, and deserialization callback.

initialize(client: Any, initial_response: Any, deserialization_callback: Any) -> None

Parameters

Name Description
client
Required

A pipeline service client.

initial_response
Required

The initial call response.

deserialization_callback
Required
callable or <xref:msrest.serialization.Model>

A callback that takes a Response and returns a deserialized object. If a subclass of Model is given, this passes "deserialize" as callback.

Returns

Type Description

None

resource

Return the resource of the long running operation.

resource() -> PollingReturnType_co

Returns

Type Description
any

The deserialized resource of the long running operation, if one is available.

run

Run the polling method. This method should be overridden to implement the polling logic.

async run() -> None

Returns

Type Description

None

status

Return the current status of the polling operation.

status() -> str

Returns

Type Description
str

The current status string.