-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIEventMessagePush.cs
40 lines (35 loc) · 1.37 KB
/
IEventMessagePush.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
38
39
40
using System.Collections.Generic;
using System.Threading;
namespace DataCore.Adapter.Events {
/// <summary>
/// Feature for subscribing to receive event messages from an adapter via a push notification.
/// </summary>
[AdapterFeature(
WellKnownFeatures.Events.EventMessagePush,
ResourceType = typeof(AbstractionsResources),
Name = nameof(AbstractionsResources.DisplayName_EventMessagePush),
Description = nameof(AbstractionsResources.Description_EventMessagePush)
)]
public interface IEventMessagePush : IAdapterFeature {
/// <summary>
/// Creates a push subscription.
/// </summary>
/// <param name="context">
/// The <see cref="IAdapterCallContext"/> for the caller.
/// </param>
/// <param name="request">
/// A request describing the subscription settings.
/// </param>
/// <param name="cancellationToken">
/// The cancellation token for the subscription.
/// </param>
/// <returns>
/// An <see cref="IAsyncEnumerable{T}"/> that will emit event messages as they occur.
/// </returns>
IAsyncEnumerable<EventMessage> Subscribe(
IAdapterCallContext context,
CreateEventMessageSubscriptionRequest request,
CancellationToken cancellationToken
);
}
}