IAsyncState 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將非同步流程中的所有資訊封裝在變 AsyncLocal<T> 數中。 此介面的某些實作可能不具備執行緒安全。
public interface class IAsyncState
public interface IAsyncState
type IAsyncState = interface
Public Interface IAsyncState
方法
| 名稱 | Description |
|---|---|
| Get(AsyncStateToken) |
從狀態取得儲存的非同步上下文。 |
| Initialize() |
初始化當前非同步流程中的非同步狀態。 |
| RegisterAsyncContext() |
會將新的非同步上下文與狀態註冊。 |
| Reset() |
使用後重置非同步狀態。 |
| Set(AsyncStateToken, Object) |
儲存非同步上下文。 |
| TryGet(AsyncStateToken, Object) |
嘗試從狀態取得儲存的非同步上下文。 |