本文整理汇总了C#中CacheItem.Pass方法的典型用法代码示例。如果您正苦于以下问题:C# CacheItem.Pass方法的具体用法?C# CacheItem.Pass怎么用?C# CacheItem.Pass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheItem
的用法示例。
在下文中一共展示了CacheItem.Pass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessResponse
protected override IOperationResult ProcessResponse(BinaryResponse response)
{
var status = response.StatusCode;
var result = new BinaryOperationResult();
this.StatusCode = status;
if (status == 0)
{
int flags = BinaryConverter.DecodeInt32(response.Extra, 0);
this.result = new CacheItem((ushort)flags, response.Data);
this.Cas = response.CAS;
#if EVEN_MORE_LOGGING
if (log.IsDebugEnabled)
log.DebugFormat("Get succeeded for key '{0}'.", this.Key);
#endif
return result.Pass();
}
this.Cas = 0;
#if EVEN_MORE_LOGGING
if (log.IsDebugEnabled)
log.DebugFormat("Get failed for key '{0}'. Reason: {1}", this.Key, Encoding.ASCII.GetString(response.Data.Array, response.Data.Offset, response.Data.Count));
#endif
var message = ResultHelper.ProcessResponseData(response.Data);
return result.Fail(message);
}
示例2: ReadResponse
protected internal override IOperationResult ReadResponse(PooledSocket socket)
{
GetResponse r = GetHelper.ReadItem(socket);
var result = new TextOperationResult();
if (r == null) return result.Fail("Failed to read response");
this.result = r.Item;
this.Cas = r.CasValue;
GetHelper.FinishCurrent(socket);
return result.Pass();
}