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 async reloader function #10

Closed
renatoathaydes opened this issue Aug 24, 2019 · 1 comment
Closed

Support async reloader function #10

renatoathaydes opened this issue Aug 24, 2019 · 1 comment

Comments

@renatoathaydes
Copy link

Caches are likely to reload entries using IO, so it would be nice if you could add support for async reloader functions in the Cache class.

All that's needed, I think, is to change this typedef:

typedef V LoaderFunc<K, V>(K key, V oldValue);

To this:

typedef FutureOr<V> LoaderFunc<K, V>(K key, V oldValue);

And then, fix the couple of locations invoking this function to allow for async behaviour (which seems pretty easy).

This would not be a breaking change due to Dart's great FutureOr type allowing functions to be either sync or not transparently.

@platelk
Copy link
Owner

platelk commented Mar 8, 2021

done on 0.4.0

@platelk platelk closed this as completed Mar 8, 2021
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

2 participants