AnalyzeHealthcareEntitiesLROPoller 類別
- 繼承
-
azure.core.polling._poller.LROPollerAnalyzeHealthcareEntitiesLROPoller
建構函式
AnalyzeHealthcareEntitiesLROPoller(client: Any, initial_response: Any, deserialization_callback: Callable[[Any], PollingReturnType_co], polling_method: PollingMethod[PollingReturnType_co])
參數
名稱 | Description |
---|---|
client
必要
|
|
initial_response
必要
|
|
deserialization_callback
必要
|
|
polling_method
必要
|
|
方法
add_done_callback |
新增回呼函式,以在長時間執行的作業完成之後執行 - 不論作業的狀態為何。 |
cancel |
取消目前正在輪詢的作業。 |
continuation_token |
傳回接續權杖,允許稍後重新開機輪詢器。 |
done |
檢查長時間執行作業的狀態。 |
polling_method |
傳回與此輪詢器相關聯的輪詢方法。 |
remove_done_callback |
從長時間執行的作業中移除回呼。 |
result |
傳回長時間執行作業的結果,或指定逾時之後可用的結果。 |
status |
傳回目前的狀態字串。 |
wait |
等候長時間執行的作業,以指定的時間長度。 您可以使用 「done () 」 方法來檢查此呼叫是否以逾時結束。 |
add_done_callback
新增回呼函式,以在長時間執行的作業完成之後執行 - 不論作業的狀態為何。
add_done_callback(func: Callable) -> None
參數
名稱 | Description |
---|---|
func
必要
|
至少接受一個引數的回呼函式,即已完成的 LongRunningOperation。 |
cancel
取消目前正在輪詢的作業。
cancel(**kwargs: Any) -> LROPoller[None]
僅限關鍵字的參數
名稱 | Description |
---|---|
polling_interval
|
用來輪詢取消狀態的輪詢間隔。 預設值為 5 秒。 |
傳回
類型 | Description |
---|---|
會傳回 None 的 LROPoller 實例。 |
例外狀況
類型 | Description |
---|---|
當作業已達到終端機狀態時。 |
範例
取消現有的健全狀況作業。
import os
from azure.core.exceptions import HttpResponseError
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics 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."
]
poller = text_analytics_client.begin_analyze_healthcare_entities(documents)
try:
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
done
polling_method
傳回與此輪詢器相關聯的輪詢方法。
polling_method() -> AnalyzeHealthcareEntitiesLROPollingMethod
傳回
類型 | Description |
---|---|
<xref:AnalyzeHealthcareEntitiesLROPollingMethod>
|
AnalyzeHealthcareEntitiesLROPollingMethod |
remove_done_callback
從長時間執行的作業中移除回呼。
remove_done_callback(func: Callable) -> None
參數
名稱 | Description |
---|---|
func
必要
|
要從回呼中移除的函式。 |
例外狀況
類型 | Description |
---|---|
如果長時間執行的作業已完成,則為 。 |
result
傳回長時間執行作業的結果,或指定逾時之後可用的結果。
result(timeout: float | None = None) -> PollingReturnType_co
參數
名稱 | Description |
---|---|
timeout
|
在返回控制之前等待的時間週期。 預設值: None
|
傳回
類型 | Description |
---|---|
any,
|
如果有的話,長時間執行作業的還原序列化資源。 |
例外狀況
類型 | Description |
---|---|
查詢的伺服器問題。 |
status
wait
等候長時間執行的作業,以指定的時間長度。 您可以使用 「done () 」 方法來檢查此呼叫是否以逾時結束。
wait(timeout: float | None = None) -> None
參數
名稱 | Description |
---|---|
timeout
必要
|
等候長時間執行的作業在幾秒內完成 () 。 |
例外狀況
類型 | Description |
---|---|
查詢的伺服器問題。 |
屬性
details
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應