-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathIFusionCacheBackplane.cs
37 lines (32 loc) · 1.37 KB
/
IFusionCacheBackplane.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Threading;
using System.Threading.Tasks;
namespace ZiggyCreatures.Caching.Fusion.Backplane;
/// <summary>
/// The core interface to create a FusionCache backplane.
/// </summary>
public interface IFusionCacheBackplane
{
/// <summary>
/// Subscribe to receive messages from other nodes.
/// </summary>
/// <param name="options">The backplane subscription options.</param>
void Subscribe(BackplaneSubscriptionOptions options);
/// <summary>
/// Unsubscribe from receiving messages from other nodes.
/// </summary>
void Unsubscribe();
/// <summary>
/// Send a notification to the other connected nodes, if any.
/// </summary>
/// <param name="message">The message to send.</param>
/// <param name="options">The options to use.</param>
/// <param name="token">An optional <see cref="CancellationToken"/> to cancel the operation.</param>
ValueTask PublishAsync(BackplaneMessage message, FusionCacheEntryOptions options, CancellationToken token = default);
/// <summary>
/// Send a notification to the other connected nodes, if any.
/// </summary>
/// <param name="message">The message to send.</param>
/// <param name="options">The options to use.</param>
/// <param name="token">An optional <see cref="CancellationToken"/> to cancel the operation.</param>
void Publish(BackplaneMessage message, FusionCacheEntryOptions options, CancellationToken token = default);
}