(do not look at how hugly the code is, it's just to highlight the bug.
Environment
None
Gerrit Reviews
None
Release Notes Description
None
Activity
Show:
Simon Baslé January 6, 2016 at 10:51 AM
(fixed per discussion/clarification on the correct usage)
Romain Cambier January 6, 2016 at 10:49 AM
Yep: my problem was that I had no control on the authenticator Thank you again !
Simon Baslé January 6, 2016 at 10:48 AM
no problem, reasoning about mixing blocking and non-blocking code is hard and can be counterintuitive, so I hope that I could help in that regard. I'll close this issue, then.
Romain Cambier January 6, 2016 at 10:30 AM
Well, thanks for your time & help Simon!
Simon Baslé January 6, 2016 at 10:27 AM
It is more complex than that. You are dealing with multiple asynchronous streams that have complex interactions and you throw threading/synchronization problems into the mix. This can cause race conditions, dealocks/livelocks, etc...
Blocking inside a map/flatmap is regarded as a malpractice in the Rx world, and if you absolutely must call blocking code you have to switch to proper threads using Schedulers.io() or Schedulers.newThread().
Here is a example of code to reproduce the bug:
(do not look at how hugly the code is, it's just to highlight the bug.