You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2019/12/17 11:58:36 UTC
[plc4x] branch develop updated: Fix promise chain for
InternalPlcWriteRequest
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 97cfb68 Fix promise chain for InternalPlcWriteRequest
new fd0513b Merge pull request #110 from amrod-/feature/getfix
97cfb68 is described below
commit 97cfb684d44eff34cfb06b02aadc58dee4c8da80
Author: amrod <am...@bitwolk.nl>
AuthorDate: Mon Dec 16 10:41:55 2019 +0100
Fix promise chain for InternalPlcWriteRequest
---
.../plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
index 69f7f64..3481544 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
+++ b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
@@ -325,7 +325,9 @@ public class SingleItemToSingleRequestProtocol extends ChannelDuplexHandler {
ChannelPromise subPromise = new DefaultChannelPromise(promise.channel());
Integer tdpu = correlationIdGenerator.getAndIncrement();
- CompletableFuture<InternalPlcResponse> correlatedCompletableFuture = new CompletableFuture<>()
+ CompletableFuture<InternalPlcResponse> correlatedCompletableFuture = new CompletableFuture<>();
+ // Important: don't chain to above as we want the above to be completed not the result of when complete
+ correlatedCompletableFuture
.thenApply(InternalPlcResponse.class::cast)
.whenComplete((internalPlcResponse, throwable) -> {
if (throwable != null) {