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

        if (IsExpired)
        {
            OnExpire?.Invoke();
        }
    }
Exemple #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);
        }
Exemple #3
0
    public Todo(bool isExpirable, bool isInternal, GameTime expiryTimestamp)
    {
        IsExpirable     = isExpirable;
        IsInternal      = isInternal;
        ExpiryTimestamp = expiryTimestamp;

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