loadMany function #101
nick-potts
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd love a
::loadManymethod that could be called on a state to fetch a collection of events.I started messing about with the source code, and it seems it'd need to be implemented on the
Stateclass, as well as. theStoresEventsandStoresSnapshotscontracts. I got an initial proof of concept working pretty quickly, the main goal is to reduce the massive waterfall that can happen when loading many different states at once.My use case is batch processing order updates. I receive them in batches of 250, and I'm trying to avoid pulling each one individually because it hits my database too hard.
If it is something worth doing, I don't mind contributing an initial PR.
With some very rough changes, you can see that batching the queries is possible:
Beta Was this translation helpful? Give feedback.
All reactions