/// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The cache action.</param>
 public override void NotifyChange(string key, CacheItemChangedEventAction action)
 {
     PublishMessage(BackplaneMessage.ForChanged(_identifier, key, action));
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheItemChangedEventArgs" /> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The cache action.</param>
 public CacheItemChangedEventArgs(string key, string region, CacheItemChangedEventAction action)
     : base(key, region)
 {
     Action = action;
 }
 /// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The cache action.</param>
 public override void NotifyChange(string key, string region, CacheItemChangedEventAction action)
 {
     this.PublishMessage(BackplaneMessage.ForChanged(this.identifier, key, region, action));
 }
Пример #4
0
 /// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The action.</param>
 public abstract void NotifyChange(string key, string region, CacheItemChangedEventAction action);
Пример #5
0
 /// <summary>
 /// Sends a changed message for the given <paramref name="key"/> in <paramref name="region"/>.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The action.</param>
 protected internal void TriggerChanged(string key, string region, CacheItemChangedEventAction action)
 {
     Changed?.Invoke(this, new CacheItemChangedEventArgs(key, region, action));
 }
Пример #6
0
 /// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The action.</param>
 public abstract Task NotifyChangeAsync(string key, string region, CacheItemChangedEventAction action);
Пример #7
0
 /// <summary>
 /// Sends a changed message for the given <paramref name="key"/>.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The action.</param>
 protected internal void TriggerChangedAsync(string key, CacheItemChangedEventAction action)
 {
     ChangedAsync?.Invoke(this, new CacheItemChangedEventArgs(key, action));
 }
Пример #8
0
 /// <summary>
 /// Sends a changed message for the given <paramref name="key"/>.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The action.</param>
 protected internal void TriggerChanged(TKey key, CacheItemChangedEventAction action)
 {
     Changed?.Invoke(this, new CacheItemChangedEventArgs <TKey>(key, action));
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheItemChangedEventArgs{TKey}" /> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The cache action.</param>
 public CacheItemChangedEventArgs(TKey key, CacheItemChangedEventAction action)
     : base(key)
 {
     Action = action;
 }
Пример #10
0
        //private BackplaneMessage(byte[] owner, BackplaneAction action, string key, string region)
        //    : this(owner, action, key)
        //{
        //    NotNullOrWhiteSpace(region, nameof(region));

        //    Region = region;
        //}

        private BackplaneMessage(byte[] owner, BackplaneAction action, string key, CacheItemChangedEventAction changeAction)
            : this(owner, action, key)
        {
            ChangeAction = changeAction;
        }
Пример #11
0
 /// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The action.</param>
 public abstract void NotifyChange(TKey key, CacheItemChangedEventAction action);
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheItemChangedEventArgs" /> class.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="action">The cache action.</param>
 public CacheItemChangedEventArgs(string key, CacheItemChangedEventAction action)
     : base(key)
 {
     this.Action = action;
 }
Пример #13
0
 /// <summary>
 /// Creates a new <see cref="BackplaneMessage"/> for the changed action.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="changeAction">The cache change action.</param>
 /// <returns>The new <see cref="BackplaneMessage"/> instance.</returns>
 public static BackplaneMessage ForChanged(string owner, string key, string region, CacheItemChangedEventAction changeAction) =>
 new BackplaneMessage(owner, Changed, key, region, changeAction);
Пример #14
0
 private BackplaneMessage(string owner, BackplaneAction action, string key, string region, CacheItemChangedEventAction changeAction)
     : this(owner, action, key, region)
 {
     this.ChangeAction = changeAction;
 }
Пример #15
0
 /// <summary>
 /// Notifies other cache clients about a changed cache key.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="region">The region.</param>
 /// <param name="action">The cache action.</param>
 public override Task NotifyChangeAsync(string key, string region, CacheItemChangedEventAction action)
 {
     return(PublishMessageAsync(BackplaneMessage.ForChanged(_identifier, key, region, action)));
 }
Пример #16
0
 /// <summary>
 /// Creates a new <see cref="BackplaneMessage"/> for the changed action.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="key">The key.</param>
 /// <param name="changeAction">The cache change action.</param>
 /// <returns>The new <see cref="BackplaneMessage"/> instance.</returns>
 public static BackplaneMessage ForChanged(byte[] owner, string key, CacheItemChangedEventAction changeAction) =>
 new BackplaneMessage(owner, Changed, key, changeAction);