generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathIEventSender.cs
29 lines (26 loc) · 1.12 KB
/
IEventSender.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
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace CoreEx.Events
{
/// <summary>
/// Defines the standardized <b>Event</b> sending via the actual messaging platform/protocol.
/// </summary>
/// <remarks>The <see cref="EventSendData.Data"/> is expected to be already serialized <see cref="IEventSerializer"/>.</remarks>
public interface IEventSender
{
/// <summary>
/// Sends one or more <see cref="EventSendData"/> objects.
/// </summary>
/// <param name="events">One or more <see cref="EventData"/> objects to be sent.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task SendAsync(IEnumerable<EventSendData> events, CancellationToken cancellationToken = default);
/// <summary>
/// Occurs after a successful <see cref="SendAsync"/>.
/// </summary>
event EventHandler? AfterSend;
}
}