IBufferDistributedCache.SetAsync Metoda

Definicja

Asynchronicznie ustawia lub zastępuje wpis pamięci podręcznej.

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

Parametry

key
String

Klucz wpisu do utworzenia.

value
ReadOnlySequence<Byte>

Wartość tego wpisu pamięci podręcznej.

options
DistributedCacheEntryOptions

Opcje pamięci podręcznej dla wartości.

token
CancellationToken

Służy CancellationToken do propagacji powiadomień, że operacja powinna zostać anulowana.

Zwraca

Uwagi

Ta metoda jest funkcjonalnie podobna do SetAsync(String, Byte[], DistributedCacheEntryOptions, CancellationToken)metody , ale pozwala uniknąć alokacji tablicy.

Dotyczy