-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add event notification feature
- Loading branch information
1 parent
805f0f2
commit c77b14f
Showing
17 changed files
with
344 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
src/KafkaFlow.Abstractions/Consumers/WorkerStoppedSubject.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/KafkaFlow.Abstractions/Consumers/WorkerStoppingSubject.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace KafkaFlow | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// Represents an Event to be subscribed. | ||
/// </summary> | ||
public interface IEvent | ||
{ | ||
/// <summary> | ||
/// Subscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
void Subscribe(Func<Task> handler); | ||
|
||
/// <summary> | ||
/// Unsubscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
void Unsubscribe(Func<Task> handler); | ||
} | ||
|
||
/// <summary> | ||
/// Represents an Event to be subscribed. | ||
/// </summary> | ||
/// <typeparam name="TArg">The argument expected by the event.</typeparam> | ||
public interface IEvent<TArg> | ||
{ | ||
/// <summary> | ||
/// Subscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
void Subscribe(Func<TArg, Task> handler); | ||
|
||
/// <summary> | ||
/// Unsubscribes to the event. | ||
/// </summary> | ||
/// <param name="handler">The handler to be called when the event is fired.</param> | ||
void Unsubscribe(Func<TArg, Task> handler); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.