コード例 #1
0
 /// <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;
 }
コード例 #3
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 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);
コード例 #12
0
 /// <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);