C# Класс Flatwhite.Hot.Phoenix

A class contains all the info to create the new fresh cache item when cache is about to expire
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_info CacheItem
_phoenixState IPhoenixState

Private Properties

Свойство Тип Описание
DieAsync Task
GetCacheItem CacheItem
GetCurrentState IPhoenixState
GetTargetInstance object
InvokeAndGetBareResult Task
RebornCallback void

Открытые методы

Метод Описание
Dispose ( ) : void

Dispose the timer and remove it from Global.Cache

Phoenix ( _IInvocation invocation, CacheItem info ) : System

Initialize a phoenix with provided cacheDuration and staleWhileRevalidate values

Reborn ( ) : void

Refresh the cache and change the internal IPhoenixState to avoid refreshing too many unnecessary times

The call will happen in background so the caller will not have to wait

Защищенные методы

Метод Описание
FireAsync ( ) : Task

Rebuild the cache and return the new IPhoenixState

Retry ( System.TimeSpan timeSpan ) : void

Retry phoenix reborn after a timespan

Приватные методы

Метод Описание
DieAsync ( ) : Task
GetCacheItem ( object invocationBareResult ) : CacheItem
GetCurrentState ( ) : IPhoenixState
GetTargetInstance ( ICacheDependencyScope scope ) : object
InvokeAndGetBareResult ( object serviceInstance ) : Task
RebornCallback ( object phoenixId ) : void

Описание методов

Dispose() публичный Метод

Dispose the timer and remove it from Global.Cache
public Dispose ( ) : void
Результат void

FireAsync() защищенный Метод

Rebuild the cache and return the new IPhoenixState
protected FireAsync ( ) : Task
Результат Task

Phoenix() публичный Метод

Initialize a phoenix with provided cacheDuration and staleWhileRevalidate values
public Phoenix ( _IInvocation invocation, CacheItem info ) : System
invocation _IInvocation
info CacheItem
Результат System

Reborn() публичный Метод

Refresh the cache and change the internal IPhoenixState to avoid refreshing too many unnecessary times

The call will happen in background so the caller will not have to wait

public Reborn ( ) : void
Результат void

Retry() защищенный Метод

Retry phoenix reborn after a timespan
protected Retry ( System.TimeSpan timeSpan ) : void
timeSpan System.TimeSpan
Результат void

Описание свойств

_info защищенное свойство

Get information about the cache
protected CacheItem _info
Результат CacheItem

_phoenixState защищенное свойство

Phoenix state
protected IPhoenixState _phoenixState
Результат IPhoenixState