From c361af3b3c4e6eabdfb7fe4428bc2cfb6e2b7fbe Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Fri, 20 Dec 2024 11:31:17 +0100 Subject: [PATCH] Added Unsubscribe method Clarified contribution license requirements in readme --- README.md | 5 ++++- Tapeti/IConnection.cs | 6 ++++++ Tapeti/TapetiConnection.cs | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9b0c72..6313ced 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,7 @@ Master build (stable release) [![Build status](https://ci.appveyor.com/api/projects/status/cyuo0vm7admy0d9x/branch/master?svg=true)](https://ci.appveyor.com/project/MvRens/tapeti/branch/master) Latest build -[![Build status](https://ci.appveyor.com/api/projects/status/cyuo0vm7admy0d9x?svg=true)](https://ci.appveyor.com/project/MvRens/tapeti) \ No newline at end of file +[![Build status](https://ci.appveyor.com/api/projects/status/cyuo0vm7admy0d9x?svg=true)](https://ci.appveyor.com/project/MvRens/tapeti) + +## Contributing +By contributing to Tapeti's main repository (https://github.com/MvRens/Tapeti) you agree to dedicate your code-base contributions to the public domain under the Unlicense license. \ No newline at end of file diff --git a/Tapeti/IConnection.cs b/Tapeti/IConnection.cs index da478e0..c08379c 100644 --- a/Tapeti/IConnection.cs +++ b/Tapeti/IConnection.cs @@ -84,6 +84,12 @@ namespace Tapeti ISubscriber SubscribeSync(bool startConsuming = true); + /// + /// Stops the current subscriber. + /// + Task Unsubscribe(); + + /// /// Returns an IPublisher implementation for the current connection. /// diff --git a/Tapeti/TapetiConnection.cs b/Tapeti/TapetiConnection.cs index 8898b3a..820d5e1 100644 --- a/Tapeti/TapetiConnection.cs +++ b/Tapeti/TapetiConnection.cs @@ -80,6 +80,13 @@ namespace Tapeti } + /// + public Task Unsubscribe() + { + return subscriber?.Stop() ?? Task.CompletedTask; + } + + /// public IPublisher GetPublisher() {