-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SendEventBatchSucceededEventArgs.cs
59 lines (54 loc) · 2.33 KB
/
SendEventBatchSucceededEventArgs.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading;
namespace Azure.Messaging.EventHubs.Producer
{
/// <summary>
/// Contains information about a batch that was published and the partition
/// that it was published to.
/// </summary>
///
public class SendEventBatchSucceededEventArgs : EventArgs
{
/// <summary>
/// The set of events in the batch that was published.
/// </summary>
///
public IReadOnlyList<EventData> EventBatch { get; }
/// <summary>
/// The identifier of the partition that the batch was published to.
/// </summary>
///
public string PartitionId { get; }
/// <summary>
/// A <see cref="System.Threading.CancellationToken"/> to indicate that the producer is being closed
/// or disposed and is requesting that the handler stop its activities.
/// </summary>
///
/// <remarks>
/// The handler processing events has responsibility for deciding whether or not to honor
/// the cancellation request. If the application chooses not to do so, the producer will wait for the
/// handler to complete before shutting down.
/// </remarks>
///
public CancellationToken CancellationToken { get; }
/// <summary>
/// Initializes a new instance of the <see cref="SendEventBatchSucceededEventArgs"/> class.
/// </summary>
///
/// <param name="eventBatch">The set of events in the batch that was published.</param>
/// <param name="partitionId">The identifier of the partition that the batch was published to.</param>
/// <param name="cancellationToken">A <see cref="System.Threading.CancellationToken"/> instance to signal the request to cancel the operation.</param>
///
public SendEventBatchSucceededEventArgs(IReadOnlyList<EventData> eventBatch,
string partitionId,
CancellationToken cancellationToken)
{
EventBatch = eventBatch;
PartitionId = partitionId;
CancellationToken = cancellationToken;
}
}
}