IBufferDistributedCache.TryGetAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously attempts to retrieve an existing cache entry.
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)
Parameters
- key
- String
The unique key for the cache entry.
- destination
- IBufferWriter<Byte>
The target to write the cache contents on success.
- token
- CancellationToken
The CancellationToken used to propagate notifications that the operation should be canceled.
Returns
true
if the cache entry is found, false
otherwise.
Remarks
This method is functionally similar to GetAsync(String, CancellationToken), but avoids the array allocation.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET