-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
EventHubsPlugin.cs
34 lines (30 loc) · 1.35 KB
/
EventHubsPlugin.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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.EventHubs.Core
{
using System.Threading.Tasks;
/// <summary>
/// This class provides methods that can be overridden to manipulate messages for custom plugin functionality.
/// </summary>
public abstract class EventHubsPlugin
{
/// <summary>
/// Gets the name of the <see cref="EventHubsPlugin" />.
/// </summary>
/// <remarks>This name is used to identify the plugin, and prevent a plugin from being registered multiple times.</remarks>
public abstract string Name { get; }
/// <summary>
/// Determines whether or an exception in the plugin should prevent a send or receive operation.
/// </summary>
public virtual bool ShouldContinueOnException => false;
/// <summary>
/// This operation is called before an event is sent.
/// </summary>
/// <param name="eventData">The <see cref="EventData" /> to be modified by the plugin</param>
/// <returns>The modified event <see cref="EventData" /></returns>
public virtual Task<EventData> BeforeEventSend(EventData eventData)
{
return Task.FromResult(eventData);
}
}
}