AsyncAnalyzeHealthcareEntitiesLROPoller Class
- Inheritance
-
azure.core.polling._async_poller.AsyncLROPollerAsyncAnalyzeHealthcareEntitiesLROPoller
Constructor
AsyncAnalyzeHealthcareEntitiesLROPoller(client: Any, initial_response: Any, deserialization_callback: Callable[[Any], PollingReturnType_co], polling_method: AsyncPollingMethod[PollingReturnType_co])
Parameters
Name | Description |
---|---|
client
Required
|
|
initial_response
Required
|
|
deserialization_callback
Required
|
|
polling_method
Required
|
|
Methods
cancel |
Cancel the operation currently being polled. |
continuation_token |
Return a continuation token that allows to restart the poller later. |
done |
Check status of the long running operation. |
polling_method |
Return the polling method associated to this poller. |
result |
Return the result of the long running operation. |
status |
Returns the current status string. |
wait |
Wait on the long running operation. |
cancel
Cancel the operation currently being polled.
async cancel(**kwargs: Any) -> AsyncLROPoller[None]
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
Returns an instance of an AsyncLROPoller that returns None. |
Exceptions
Type | Description |
---|---|
When the operation has already reached a terminal state. |
Examples
Cancel an existing health operation.
import os
from azure.core.exceptions import HttpResponseError
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics.aio import TextAnalyticsClient
endpoint = os.environ["AZURE_LANGUAGE_ENDPOINT"]
key = os.environ["AZURE_LANGUAGE_KEY"]
text_analytics_client = TextAnalyticsClient(
endpoint=endpoint,
credential=AzureKeyCredential(key),
)
documents = [
"RECORD #333582770390100 | MH | 85986313 | | 054351 | 2/14/2001 12:00:00 AM | \
CORONARY ARTERY DISEASE | Signed | DIS | Admission Date: 5/22/2001 \
Report Status: Signed Discharge Date: 4/24/2001 ADMISSION DIAGNOSIS: \
CORONARY ARTERY DISEASE. HISTORY OF PRESENT ILLNESS: \
The patient is a 54-year-old gentleman with a history of progressive angina over the past several months. \
The patient had a cardiac catheterization in July of this year revealing total occlusion of the RCA and \
50% left main disease , with a strong family history of coronary artery disease with a brother dying at \
the age of 52 from a myocardial infarction and another brother who is status post coronary artery bypass grafting. \
The patient had a stress echocardiogram done on July , 2001 , which showed no wall motion abnormalities ,\
but this was a difficult study due to body habitus. The patient went for six minutes with minimal ST depressions \
in the anterior lateral leads , thought due to fatigue and wrist pain , his anginal equivalent. Due to the patient's \
increased symptoms and family history and history left main disease with total occasional of his RCA was referred \
for revascularization with open heart surgery."
]
async with text_analytics_client:
poller = await text_analytics_client.begin_analyze_healthcare_entities(documents)
try:
await poller.cancel()
except HttpResponseError as e:
# If the operation has already reached a terminal state it cannot be cancelled.
print(e)
else:
print("Healthcare entities analysis was successfully cancelled.")
continuation_token
Return a continuation token that allows to restart the poller later.
continuation_token() -> str
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
An opaque continuation token |
Exceptions
Type | Description |
---|---|
When the operation has already reached a terminal state. |
done
Check status of the long running operation.
done() -> bool
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
'True' if the process has completed, else 'False'. |
Exceptions
Type | Description |
---|---|
When the operation has already reached a terminal state. |
polling_method
Return the polling method associated to this poller.
polling_method() -> AsyncAnalyzeHealthcareEntitiesLROPollingMethod
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
<xref:AsyncAnalyzeHealthcareEntitiesLROPollingMethod>
|
AsyncAnalyzeHealthcareEntitiesLROPollingMethod |
Exceptions
Type | Description |
---|---|
When the operation has already reached a terminal state. |
result
Return the result of the long running operation.
async result() -> PollingReturnType_co
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
any,
|
The deserialized resource of the long running operation, if one is available. |
Exceptions
Type | Description |
---|---|
Server problem with the query. |
status
Returns the current status string.
status() -> str
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Returns
Type | Description |
---|---|
The current status string |
Exceptions
Type | Description |
---|---|
When the operation has already reached a terminal state. |
wait
Wait on the long running operation.
async wait() -> None
Keyword-Only Parameters
Name | Description |
---|---|
polling_interval
|
The polling interval to use to poll the cancellation status. The default value is 5 seconds. |
Exceptions
Type | Description |
---|---|
Server problem with the query. |