-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIWriteEventMessages.cs
45 lines (41 loc) · 1.64 KB
/
IWriteEventMessages.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
41
42
43
44
45
using System.Collections.Generic;
using System.Threading;
namespace DataCore.Adapter.Events {
/// <summary>
/// Feature that allows event messages to be written to an adapter.
/// </summary>
[AdapterFeature(
WellKnownFeatures.Events.WriteEventMessages,
ResourceType = typeof(AbstractionsResources),
Name = nameof(AbstractionsResources.DisplayName_WriteEventMessages),
Description = nameof(AbstractionsResources.Description_WriteEventMessages)
)]
public interface IWriteEventMessages : IAdapterFeature {
/// <summary>
/// Writes a stream of event messages to an adapter.
/// </summary>
/// <param name="context">
/// The <see cref="IAdapterCallContext"/> for the caller.
/// </param>
/// <param name="request">
/// The request.
/// </param>
/// <param name="channel">
/// An <see cref="IAsyncEnumerable{T}"/> that will provide the event messages to write
/// to the adapter.
/// </param>
/// <param name="cancellationToken">
/// The cancellation token for the operation.
/// </param>
/// <returns>
/// An <see cref="IAsyncEnumerable{T}"/> that will emit a write result for each item
/// read from the input <paramref name="channel"/>.
/// </returns>
IAsyncEnumerable<WriteEventMessageResult> WriteEventMessages(
IAdapterCallContext context,
WriteEventMessagesRequest request,
IAsyncEnumerable<WriteEventMessageItem> channel,
CancellationToken cancellationToken
);
}
}