You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by bl...@apache.org on 2020/12/22 14:45:05 UTC
[pulsar-dotpulsar] branch master updated: Should not throw an
exception when disposing a consumer, reader or producer
This is an automated email from the ASF dual-hosted git repository.
blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 50d5219 Should not throw an exception when disposing a consumer, reader or producer
50d5219 is described below
commit 50d52192d76419416e074492b060dc6baf3d54c6
Author: Daniel Blankensteiner <db...@vmail.dk>
AuthorDate: Tue Dec 22 15:44:53 2020 +0100
Should not throw an exception when disposing a consumer, reader or producer
---
CHANGELOG.md | 6 ++++++
src/DotPulsar/Internal/NotReadyChannel.cs | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5e33f2..be9ea7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Fixed
+
+- Do not throw exceptions when disposing consumers, readers or producers
+
## [0.10.0] - 2020-12-16
### Added
diff --git a/src/DotPulsar/Internal/NotReadyChannel.cs b/src/DotPulsar/Internal/NotReadyChannel.cs
index 60f0cbf..5590138 100644
--- a/src/DotPulsar/Internal/NotReadyChannel.cs
+++ b/src/DotPulsar/Internal/NotReadyChannel.cs
@@ -27,6 +27,9 @@ namespace DotPulsar.Internal
public ValueTask DisposeAsync()
=> new ValueTask();
+ public ValueTask ClosedByClient(CancellationToken cancellationToken)
+ => new ValueTask();
+
public ValueTask<Message> Receive(CancellationToken cancellationToken = default)
=> throw GetException();
@@ -51,9 +54,6 @@ namespace DotPulsar.Internal
public Task<CommandGetLastMessageIdResponse> Send(CommandGetLastMessageId command, CancellationToken cancellationToken)
=> throw GetException();
- public ValueTask ClosedByClient(CancellationToken cancellationToken)
- => throw GetException();
-
private static Exception GetException()
=> new ChannelNotReadyException();
}