/// <summary>
        /// Initializes a new instance of the <see cref="CacheClearRegionEventArgs"/> class.
        /// </summary>
        /// <param name="region">The region.</param>
        /// <param name="origin">The origin the event ocured. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
        /// <exception cref="System.ArgumentNullException">If region is null.</exception>
        public CacheClearRegionEventArgs(string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
        {
            NotNullOrWhiteSpace(region, nameof(region));

            Region = region;
            Origin = origin;
        }
Ejemplo n.º 2
0
 private void Update(CacheEvent ev, string key, CacheActionEventArgOrigin origin)
 {
     if (origin == CacheActionEventArgOrigin.Local)
     {
         Interlocked.Increment(ref _updates[ev][0]);
     }
     else
     {
         Interlocked.Increment(ref _updates[ev][1]);
     }
 }
Ejemplo n.º 3
0
 private void TriggerOnUpdate(string key, string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnUpdate?.Invoke(this, new CacheActionEventArgs(key, region, origin));
 }
Ejemplo n.º 4
0
 private void TriggerOnRemove(string key, string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     NotNullOrWhiteSpace(key, nameof(key));
     OnRemove?.Invoke(this, new CacheActionEventArgs(key, region, origin));
 }
Ejemplo n.º 5
0
 private void TriggerOnClearRegion(string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnClearRegion?.Invoke(this, new CacheClearRegionEventArgs(region, origin));
 }
Ejemplo n.º 6
0
 private void TriggerOnClear(CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnClear?.Invoke(this, new CacheClearEventArgs(origin));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheClearEventArgs"/> class.
 /// </summary>
 /// <param name="origin">The origin the event ocured. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
 public CacheClearEventArgs(CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     Origin = origin;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheActionEventArgs"/> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="origin">The origin the event ocured. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
 /// <exception cref="System.ArgumentNullException">If key is null.</exception>
 public CacheActionEventArgs(string key, string region, CacheActionEventArgOrigin origin)
     : this(key, region)
 {
     Origin = origin;
 }
 private void TriggerOnUpdate(TKey key, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     OnUpdate?.Invoke(this, new CacheActionEventArgs <TKey>(key, origin));
 }
Ejemplo n.º 10
0
 private void TriggerOnRemove(TKey key, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
 {
     NotNull(key, nameof(key));
     OnRemove?.Invoke(this, new CacheActionEventArgs <TKey>(key, origin));
 }