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

func read(keys: [CacheKey]) async -> [Data] should be deprecated #26

Open
dannynorth opened this issue Oct 12, 2023 · 0 comments
Open

Comments

@dannynorth
Copy link
Contributor

There's no good way to implement this correctly, because there's no way for users to know whether specific passed-in keys have been skipped due to non-existence.

For example:

let keys = [goodKey1, badKey2, badKey3, goodKey4, badKey5, goodKey6]
let data = await storage.read(keys: keys)

// data contains three values, but for which keys?
dannynorth added a commit to dannynorth/Bodega that referenced this issue Oct 12, 2023
Fixes mergesort#24

Using `zip()` loses the association between keys and values, because the array returned from `read(keys:)` does not provide information about _skipped_ keys (See mergesort#26).
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

1 participant