markdown guide

Thanks, both. Let me elaborate on the use case.
Let's say there are API calls being made sequentially but some time can be saved by making those in parallel.
What would best suit in this case?

While completeableFuture fits the purpose as well, I also wanted to start with reactive programming somewhere and this could be one of the places - but again don't want it to be an overkill for this particular use case.


I think you answered your own question:

  1. Use completeableFuture if it's the simplest solution that solves the problem
  2. If you want to get into reactive programming, I think you'll need to find a more complex use case or risk overkill.

Is your question related to Parallelization (many things happening concurrently) or Asynchronicity (you have to wait for things to finish before you proceed)? You would typically (but not necessarily) need Asynchronicity for Parallelization, but the topics are distinct. For example, Futures/Asycn/Await/Promises/Callbacks tend to fall under the topic of Asynchronicity; where Threads/Actors/Queues/Sub-Processes tend to deal with Parallelization.

The libraries you are referencing imply your question is about Asynchronicity, in which case in the Java ecosystem I think you're looking at the right libraries, but which you would choose depends on your specific situation. Every popular library in any ecosystem has a particular context where it's considered to be a better option than the alternatives - that's why it's popular. The question is, of the alternatives, which is the best choice for your context?


RxJava can become overly complex and is harder to debug. I had a better experience with reactor, but that was mainly because that was just trying it out, while RxJava was with a large existing project.
I don't know what's the reason you want to use it. For example you can also do parallel progressing in a stream, which might be enough for your use case.

Classic DEV Post from Dec 22 '18

How does your workplace approach recognition?

Does your workplace have a strategy for recognising team members?

Rinky Goyal @GraphQLConf profile image
Software Developer @Expedia | Technologist | Opinionated | #womenInTech