Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dartheian opened this issue Jun 21, 2021 · 0 comments
Open

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

dartheian opened this issue Jun 21, 2021 · 0 comments

Comments

@dartheian
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant