abort operations with AbortController #11811
jimmywarting
started this conversation in
Ideas
Replies: 2 comments 5 replies
-
Makes sense. Does mongodb native driver support an AbortController? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Any latest info on this? I would also really like to have this feature. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
An AbortController can come from multiple places such as a spec compatible whatwg/Request or some server that wraps incoming http server request into a standard whatwg/request with a AbortSignal. they can also be constructed with
new AbortController()
or the new proposedAbortController.timeout(ms)
This are useful b/c the can cancel multiple operations simultaneously at once.
calling
abort()
on the controller could close the request connection, stop listening on a other multiple event listener,addEventListener(name, fn, { signal })
and many more thing at once. this signal could also be forwarded to mongoose operation too, to abort any mongodb operation if say a user decide to close the request/connectionit would be cool if the
.find()
, and.cursor()
could take an optional{ signal }
parameter that abort the hole operation when the signal dispatch an abort event, likewise withdb.connect()
and also aggregationBeta Was this translation helpful? Give feedback.
All reactions