-
Notifications
You must be signed in to change notification settings - Fork 352
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
feat: Prefetch #3072
base: develop
Are you sure you want to change the base?
feat: Prefetch #3072
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
@simolus3 Still needs docs and tests, but otherwise is complete. |
🚧WIP🚧 This is how prefetching will work under the hood Step 1 - The CallbackThe user decides what he would like prefetch by using an optional call back in the withReferences((o)=> o(prefetchUsers: true)).get() Running the Well, the return value from o(prefetchUsers: true) // Future<Prefetches> Function()
await o(prefetchUsers: true)() // Prefetches Calling it will return a Step 2 - PrefetchesWell, what is a prefetches? Step 3 - OK, When are we running this?Well, we don't run
So when do we run them? So calling Step 4 - OK, I want my references nowSure, when you finally run So when you finally run final (group,refs) = await groups.withReferences((o)=> o(prefetchUsers: true)).getSingle()
final users = await refs.users.get(); The refs object will insert the appropriate users from the prefetches into the cache of the newly created table manager (remember If you don't understand this, it's ok. It will make sense once you see the code (I hope) |
TBD