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

Support abort signal in iterator.all() #13

Closed
ronag opened this issue Apr 1, 2022 · 3 comments
Closed

Support abort signal in iterator.all() #13

ronag opened this issue Apr 1, 2022 · 3 comments

Comments

@ronag
Copy link
Contributor

ronag commented Apr 1, 2022

Currently there is no good way to abort a iterator.all() call. Would be nice if the api could support AbortController.

@vweevers
Copy link
Member

vweevers commented Apr 3, 2022

If your all() call is a long-running operation (getting many entries) it might not be the best method to use. For that same reason, all() currently uses nextv() under the hood, rather than a dedicated and optimized C++ method for all(). Because I assumed that the iterator typically just needs a few nextv() calls to get all entries. That does give us a way to abort, in between nextv() calls, but I'm not sure that fits your use case.

Assuming that we did have such a dedicated method, let's say iterator_all() - how would we cancel the async work in C++?

@vweevers
Copy link
Member

vweevers commented Nov 14, 2022

Level/abstract-level#55 (as noted there, implementations have to handle the aborting, so there will be additional work here).

@vweevers vweevers added this to Level Feb 10, 2023
@vweevers vweevers moved this to Backlog in Level Feb 10, 2023
@vweevers vweevers moved this from Backlog to Todo in Level Feb 10, 2023
@vweevers
Copy link
Member

Done in 2.0.0.

@github-project-automation github-project-automation bot moved this from Todo to Done in Level Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants