Example #1
0
    public override void ProgressInTime(GameTime hour)
    {
        base.ProgressInTime(hour);

        if (IsExpired)
        {
            OnExpire?.Invoke();
        }
    }
Example #2
0
        public CacheCallInfo(int expiresTimeoutSeconds, OnExpire onExpire)
        {
            Timer tm = null;

            tm = new Timer(delegate(object state)
            {
                onExpire(this);
                tm.Dispose();
            }, null, expiresTimeoutSeconds * 1000, 0);
        }
Example #3
0
    public Todo(bool isExpirable, bool isInternal, GameTime expiryTimestamp)
    {
        IsExpirable     = isExpirable;
        IsInternal      = isInternal;
        ExpiryTimestamp = expiryTimestamp;

        if (ExpiryTimestamp <= CreatedAt)
        {
            OnExpire?.Invoke();
        }
    }
Example #4
0
 public void Expire() => OnExpire?.Invoke(this);
Example #5
0
 protected void FireOnExpire()
 {
     Core.Log.LibVerbose("On Expire timer for key: {0}", Key);
     OnExpire?.Invoke(this, EventArgs.Empty);
 }