ISolutionCacheService.TryGetItemAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
尝试从缓存中检索分配给特定键的项。
public:
System::Threading::Tasks::Task<bool> ^ TryGetItemAsync(Microsoft::VisualStudio::RpcContracts::Caching::CacheItemKey key, System::IO::Pipelines::PipeWriter ^ writer, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<bool> TryGetItemAsync (Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey key, System.IO.Pipelines.PipeWriter writer, System.Threading.CancellationToken cancellationToken);
abstract member TryGetItemAsync : Microsoft.VisualStudio.RpcContracts.Caching.CacheItemKey * System.IO.Pipelines.PipeWriter * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function TryGetItemAsync (key As CacheItemKey, writer As PipeWriter, cancellationToken As CancellationToken) As Task(Of Boolean)
参数
- key
- CacheItemKey
缓存项键,它是从实例中其检索的 usualy CacheContainer 。
- writer
- PipeWriter
用于流式传输内容的编写器。
- cancellationToken
- CancellationToken
要监视的取消标记。
返回
如果找到项并且数据流入写入器,则为 true; 否则为 false。