Is there an option to have variant of timeout
that does not emit Throwable
?
I would like to have complete
event emited.
When first configuring (or on occasion after setup is complete), you may see an error indicating “RX Timeout!” when sending a command or poll to the Serial MODBUS Gateway. This indicates there is a communication error and is generally a result of a configuration or wiring issue.
Usually, asynchronous code is non-blocking: You call a method that returns immediately, allowing your code to continue its execution. Once the result of your call is available, it is returned via a callback. RxJava is asynchronous, too. And it is blocking as well — at least by default.
You don't need to map errors with onErrorResumeNext. You can just provide a backup observable using:
timeout(long,TimeUnit,Observable)
It would be something like:
.timeout(500, TimeUnit.MILLISECONDS, Observable.empty())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With