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

Batch reading from DB #36

Open
0xmikko opened this issue May 27, 2020 · 2 comments
Open

Batch reading from DB #36

0xmikko opened this issue May 27, 2020 · 2 comments

Comments

@0xmikko
Copy link

0xmikko commented May 27, 2020

As I mentioned in #34, there is a problem in reading all key-value pairs from DB.

As possible solution it could stream reading (like ReadableStream) or getting values by sending a list of keys like that:

const values = bluzelle.read(keys: string[]);

@njmurarka
Copy link
Contributor

@scottburch Related to #34 and #35

@scottburch
Copy link
Collaborator

scottburch commented May 28, 2020

Thanks for the suggestions. I will be looking into the issues and then we will make a determination as to the best path.
For now you can accomplish that same thing by using a Promise.all.

const values = await Promise.all(keys.map(key => bluzelle.read(key))

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

3 participants