Skip to content

Should race be symmetrical to parallel? #18

@rpominov

Description

@rpominov

It's easier to show using type signatures. Should it be like the following?

parallel(tasks: Array<Task<S, F>>): Task<Array<S>, F>
race    (tasks: Array<Task<S, F>>): Task<S, Array<F>>

The description of race would change from:

Given array of tasks creates a task that completes with the earliest successful or failure value

to:

Given array of tasks creates a task that completes with the earliest successful value or, if all tasks fail, with array of failure values.

I don't have strong opinion yet, just discovered that we could make parallel and race symmetrical, and thought that maybe it's a good idea. Need to consider all the use-cases...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions