DEV Community

Discussion on: Aborting a signal: How to cancel an asynchronous task in JavaScript

Collapse
 
rhymes profile image
rhymes

This is super interesting, thanks @comandeer !

Reminds me of how Go does cancellations of asynchronous goroutines: Using context cancellation in Go.

Is it possible to set timeouts directly on the AbortController or one would need to have another timer that can sends the signal?

Collapse
 
comandeer profile image
Tomasz Jakut

I don’t exactly understand what you mean by setting timeout directly on AbortController. Its API does not provide such functionality, timeout must be set sepearately and then just invoke appropriate method on AbortController.

Collapse
 
rhymes profile image
rhymes

You actually answered to my question, thanks!