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

Consider: Allow multi-key requests to receive their data callback in order #1

Open
ecton opened this issue Sep 28, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ecton
Copy link
Member

ecton commented Sep 28, 2021

The current implementation of get_multiple and scan both take a key reader and key evaluator function. The reader is invoked for each key as it is found, and the result controls the iteration over the tree. If data is requested to be read, it will be requested after the scan is completed, ordered from the start of the file to the end of the file to try to optimize access.

For callers that need to scan the content of the data but might still want to abort the scan, this forces the scan to iterate over the entire tree. This change in functionality could enable the key evaluator to be invoked immediately after the read data request is returned. This would allow the evaluator or next call to the reader to stop the scan.

Currently, no code that calls these functions in BonsaiDb needs this functionality, but as a general purpose library, this functionality could be very useful.

@ecton ecton added the enhancement New feature or request label Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant