Jazyk

IBufferDistributedCache.TryGetAsync Metoda

Definice

Asynchronně se pokusí načíst existující položku mezipaměti.

public System.Threading.Tasks.ValueTask<bool> TryGetAsync(string key, System.Buffers.IBufferWriter<byte> destination, System.Threading.CancellationToken token = default);
abstract member TryGetAsync : string * System.Buffers.IBufferWriter<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
Public Function TryGetAsync (key As String, destination As IBufferWriter(Of Byte), Optional token As CancellationToken = Nothing) As ValueTask(Of Boolean)

Parametry

key
String

Jedinečný klíč pro položku mezipaměti.

destination
IBufferWriter<Byte>

Cíl napsat obsah mezipaměti při úspěchu.

token
CancellationToken

Používá CancellationToken se k šíření oznámení, že by měla být operace zrušena.

Návraty

true pokud je položka mezipaměti nalezena, false jinak.

Poznámky

Tato metoda je funkčně podobná GetAsync(String, CancellationToken), ale zabraňuje přidělení pole.

Platí pro