Bahasa

IBufferDistributedCache.SetAsync Metode

Definisi

Secara asinkron mengatur atau menimpa entri cache.

public System.Threading.Tasks.ValueTask SetAsync(string key, System.Buffers.ReadOnlySequence<byte> value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Threading.CancellationToken token = default);
abstract member SetAsync : string * System.Buffers.ReadOnlySequence<byte> * Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Function SetAsync (key As String, value As ReadOnlySequence(Of Byte), options As DistributedCacheEntryOptions, Optional token As CancellationToken = Nothing) As ValueTask

Parameter

key
String

Kunci entri yang akan dibuat.

value
ReadOnlySequence<Byte>

Nilai untuk entri cache ini.

options
DistributedCacheEntryOptions

Opsi cache untuk nilai .

token
CancellationToken

Yang CancellationToken digunakan untuk menyebarluaskan pemberitahuan bahwa operasi harus dibatalkan.

Mengembalikan

Keterangan

Metode ini secara fungsional mirip SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)dengan , tetapi menghindari alokasi array.

Berlaku untuk