Skip to content

Polling

Asynchronous Azure Core polling for connector operations.

Classes

ConnectorPollingMethod

ConnectorPollingMethod(http_client: Any, polling_header_name: str, *, request_url: Optional[str] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None)

Bases: AsyncPollingMethod[PollingResultT], Generic[PollingResultT]

Poll a connector operation until it returns a terminal HTTP response.

Initialize polling with the initiating request URI as the relative base.

Parameters:

Name Type Description Default
http_client Any

HTTP client used for polling requests.

required
polling_header_name str

Supported Location response header name.

required
request_url Optional[str]

Initiating operation URI for the first relative Location.

None
timeout Optional[float]

Timeout for each polling request.

None
headers Optional[Mapping[str, str]]

Additional polling request headers.

None
client_request_id Optional[str]

Caller-provided request identifier.

None
response_hook Optional[ConnectorResponseHook]

Callback invoked after a polling response.

None

Methods:

initialize
initialize(client: Any, initial_response: ConnectorResponseSnapshot, deserialization_callback: Callable[[ConnectorResponseSnapshot], PollingResultT]) -> None

Initialize polling from the operation's first response.

run async
run() -> None

Poll until the connector returns a terminal response.

status
status() -> str

Return the current Azure Core polling status.

finished
finished() -> bool

Return whether the connector has produced a terminal response.

resource
resource() -> PollingResultT

Deserialize the terminal connector response.