本文整理汇总了C#中CacheItem.GetRefreshTime方法的典型用法代码示例。如果您正苦于以下问题:C# CacheItem.GetRefreshTime方法的具体用法?C# CacheItem.GetRefreshTime怎么用?C# CacheItem.GetRefreshTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheItem
的用法示例。
在下文中一共展示了CacheItem.GetRefreshTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Phoenix
/// <summary>
/// Initialize a phoenix with provided cacheDuration and staleWhileRevalidate values
/// </summary>
/// <param name="invocation"></param>
/// <param name="info"></param>
public Phoenix(_IInvocation invocation, CacheItem info)
{
_id = Guid.NewGuid().ToString("N");
_info = info.CloneWithoutData();
_phoenixState = _info.StaleWhileRevalidate > 0 ? (IPhoenixState) new InActivePhoenix() : new DisposingPhoenix(DieAsync());
if (invocation.Proxy != null)
{
// It is really a dynamic proxy
_instanceTargetField = invocation.Proxy.GetType().GetField("__target", BindingFlags.Public | BindingFlags.Instance);
}
Arguments = invocation.Arguments;
MethodInfo = invocation.Method;
_allPhoenix[_id] = this;
//NOTE: Memory leak: http://www.codeproject.com/Questions/185734/Threading-Timer-prevents-GC-collection
_timer = new Timer(RebornCallback, _id, _info.GetRefreshTime(), TimeSpan.Zero);
}