MemoryDistributedCache.RefreshAsync 方法

定义

重载

RefreshAsync(String)
RefreshAsync(String, CancellationToken)

基于缓存中某个值的键刷新该值,并重置其可调到期超时(如果有)。Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).

RefreshAsync(String)

public:
 virtual System::Threading::Tasks::Task ^ RefreshAsync(System::String ^ key);
public System.Threading.Tasks.Task RefreshAsync (string key);
abstract member RefreshAsync : string -> System.Threading.Tasks.Task
override this.RefreshAsync : string -> System.Threading.Tasks.Task
Public Function RefreshAsync (key As String) As Task

参数

key
String

返回

Task

实现

适用于

RefreshAsync(String, CancellationToken)

基于缓存中某个值的键刷新该值,并重置其可调到期超时(如果有)。Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).

public System.Threading.Tasks.Task RefreshAsync (string key, System.Threading.CancellationToken token = default);
abstract member RefreshAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RefreshAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function RefreshAsync (key As String, Optional token As CancellationToken = Nothing) As Task

参数

key
String

用于标识所请求的值的字符串。A string identifying the requested value.

token
CancellationToken

可选。Optional. CancellationToken,用于传播应取消操作的通知。The CancellationToken used to propagate notifications that the operation should be canceled.

返回

Task

表示异步操作的 TaskThe Task that represents the asynchronous operation.

实现

适用于