Skip to content

Async 'race' and 'all' cancellation after first rejection #519

Open
@dartheian

Description

@dartheian

Running the following script in deno exits the job after 5 seconds, suggesting the first Async (the one resolving in 'OK') keeps running even after the second Async has been rejected:

import crocks from 'https://cdn.skypack.dev/crocks'
const {Async} = crocks

const test = Async.resolveAfter(5000, 'OK').race(Async.rejectAfter(1000, 'TIMEOUT'))

test.fork(console.log, console.log)

A similar behavior happens with Async.all: when a computation is rejected, all the remaining keep going.
Is this the intended behavior? I expect all the remaining computations to be cancelled and the cleanup functions to be executed after a single Aync has been rejected.

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