...

/

RxJava's Consequences: Method Signature

RxJava's Consequences: Method Signature

Learn how to use the blocking operators to address the method signature issue.

Issue: Method signature

After making the changes, the first point to note is that the method signature is no longer the same. This may not be a big deal if this method call is only used in a few places and it’s easy to propagate the changes up to other areas of the stack. However, if it breaks clients relying on this method, that’s problematic, and the method signature should be reverted.

Solution: Using .blockingX()

To address the first issue from our change, we can make use of any of the .blockingX() operators available to an Observable. Essentially, a .blockingX() operator ...