spnettec commented on PR #822:
URL: https://github.com/apache/plc4x/pull/822#issuecomment-1445251965
> The tricky part I was not able to solve yet is how to wire custom timeout
manager into the driver. The configuration instances we have are not well
defined and passing them around is not clear to me.
I think we can config in the driver
`@ConfigurationParameter("timeout-request")
@IntDefaultValue(4000)
protected int timeoutRequest;`
And send request like this
```
transaction.submit(() -> context.sendRequest(tpktPacket)
.onTimeout(new TransactionErrorCallback<>(future, transaction))
.onError(new TransactionErrorCallback<>(future, transaction))
.expectResponse(TPKTPacket.class,
Duration.ofMillis(configuration.getTimeoutRequest()))
.check(p -> p.getPayload() instanceof COTPPacketData)
.unwrap(p -> ((COTPPacketData) p.getPayload()))
.unwrap(COTPPacket::getPayload)
.check(p -> p.getTpduReference() == tpduId)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]