Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The goal of investigation was to find a way to chain async operations avoiding the so-called "pyramid of doom" or "callback hell" caused by nesting the callbacks that results in poor code readability. Even the most  innocent . In the most innocent version of two nested callbacks the code can look something like the following:

...


The approach is basically the same - decomposition on separate methods in order to improve code readability of the code. The sample module can be found on github - mod-sample-rx.

...

Conclusion

Both approaches allow to decompose the code and make it more readable. However, using rx-java would require significant changes in raml-module-builder. Therefore, using of composed futures might be the "go-to" solution while rx-java might be further investigated in case of discovering some additional benefits of using it.

sequential_composition

vert_x_api_for_rxjava2

accessing-data-reactive-way

vertx-reactive-extensions