-
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 446b720
Showing
19 changed files
with
359 additions
and
198 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,32 @@ | ||
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> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(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> | ||
/// <returns>Event subscription reference</returns> | ||
IEventSubscription Subscribe(Func<TArg, Task> handler); | ||
} | ||
} |
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,15 @@ | ||
using System; | ||
Check warning on line 1 in src/KafkaFlow.Abstractions/IEventSubscription.cs GitHub Actions / Test deployment
|
||
|
||
namespace KafkaFlow | ||
{ | ||
/// <summary> | ||
/// Represents an Event subscription. | ||
/// </summary> | ||
public interface IEventSubscription | ||
{ | ||
/// <summary> | ||
/// Cancels the subscription to the event. | ||
/// </summary> | ||
void Cancel(); | ||
} | ||
} |
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.