Skip to content

How do we ensure that completableFuture operations are done concurrently? #341

@wjiayis

Description

@wjiayis

Hi there,

Say there is a procedure as such:
Steps 1-3 are independent.
Step 4 requires steps 1-3.
Output requires steps 1, 2, 4.

May I check what functions I should call for each step so that I don't repeat computation, while ensuring that they are done with minimal total duration?

I was thinking of performing steps 1-4 using separate thenCombine(), then call join() for steps 1, 2 and 4. But I'm not sure if this would mean steps 1-2 are computed twice. I am also not sure if steps 1-3 will indeed be performed asynchronously in this procedure.

Would appreciate some help, and thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions