From 2918be18c6c6529584cd1d78e09ebb3fc0819e4f Mon Sep 17 00:00:00 2001 From: SeppPenner Date: Thu, 5 Sep 2019 10:37:55 +0200 Subject: [PATCH 1/3] Added automatic labels to the issue templates. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/custom.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1941a25..24dc74f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve. title: '' -labels: '' +labels: 'bug' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md index fb7bdc3..3e9c17d 100644 --- a/.github/ISSUE_TEMPLATE/custom.md +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -2,7 +2,7 @@ name: Custom issue template about: Do you have a question related to the project? Use this template. title: '' -labels: '' +labels: 'question' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c76e79f..d3915d5 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project. title: '' -labels: '' +labels: 'feature-request' assignees: '' --- From b12e3bc61134ad358be1dda8c273e36c307dee2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B5=D1=81=D1=81=D0=BE=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Mon, 30 Sep 2019 16:05:23 +0300 Subject: [PATCH 2/3] fix for #762 --- .../ManagedMqttClient.cs | 2 +- Source/MQTTnet/Internal/BlockingQueue.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs index c9053e4..0607d93 100644 --- a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs +++ b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs @@ -349,7 +349,7 @@ namespace MQTTnet.Extensions.ManagedClient // of the messages, the DropOldestQueuedMessage strategy would // be unable to know which message is actually the oldest and would // instead drop the first item in the queue. - var message = _messageQueue.PeekAndWait(); + var message = _messageQueue.PeekAndWait(cancellationToken); if (message == null) { continue; diff --git a/Source/MQTTnet/Internal/BlockingQueue.cs b/Source/MQTTnet/Internal/BlockingQueue.cs index 485f644..bac1a67 100644 --- a/Source/MQTTnet/Internal/BlockingQueue.cs +++ b/Source/MQTTnet/Internal/BlockingQueue.cs @@ -8,7 +8,7 @@ namespace MQTTnet.Internal { private readonly object _syncRoot = new object(); private readonly LinkedList _items = new LinkedList(); - private readonly ManualResetEvent _gate = new ManualResetEvent(false); + private readonly ManualResetEventSlim _gate = new ManualResetEventSlim(false); public int Count { @@ -32,7 +32,7 @@ namespace MQTTnet.Internal } } - public TItem Dequeue() + public TItem Dequeue(CancellationToken cancellationToken = default) { while (true) { @@ -52,11 +52,11 @@ namespace MQTTnet.Internal } } - _gate.WaitOne(); + _gate.Wait(cancellationToken); } } - public TItem PeekAndWait() + public TItem PeekAndWait(CancellationToken cancellationToken = default) { while (true) { @@ -73,7 +73,7 @@ namespace MQTTnet.Internal } } - _gate.WaitOne(); + _gate.Wait(cancellationToken); } } From 15ff03c136a65269aaaa2868388ba820f35de679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B5=D1=81=D1=81=D0=BE=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Mon, 30 Sep 2019 16:10:30 +0300 Subject: [PATCH 3/3] use C#7.0 for default arguments --- Source/MQTTnet/Internal/BlockingQueue.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/MQTTnet/Internal/BlockingQueue.cs b/Source/MQTTnet/Internal/BlockingQueue.cs index bac1a67..871c40a 100644 --- a/Source/MQTTnet/Internal/BlockingQueue.cs +++ b/Source/MQTTnet/Internal/BlockingQueue.cs @@ -32,7 +32,7 @@ namespace MQTTnet.Internal } } - public TItem Dequeue(CancellationToken cancellationToken = default) + public TItem Dequeue(CancellationToken cancellationToken = default(CancellationToken)) { while (true) { @@ -56,7 +56,7 @@ namespace MQTTnet.Internal } } - public TItem PeekAndWait(CancellationToken cancellationToken = default) + public TItem PeekAndWait(CancellationToken cancellationToken = default(CancellationToken)) { while (true) {