语言

IAsyncState 接口

定义

将异步流中的所有信息封装在变量中 AsyncLocal<T> 。 此接口的某些实现可能不是线程安全的。

public interface class IAsyncState
public interface IAsyncState
type IAsyncState = interface
Public Interface IAsyncState

方法

名称 说明
Get(AsyncStateToken)

从状态中获取存储的异步上下文。

Initialize()

初始化当前异步流中的异步状态。

RegisterAsyncContext()

使用状态注册新的异步上下文。

Reset()

使用后重置异步状态。

Set(AsyncStateToken, Object)

存储异步上下文。

TryGet(AsyncStateToken, Object)

尝试从状态获取存储的异步上下文。

适用于