Mattias Flodin
06/14/2022, 1:47 PMAdam Powell
06/14/2022, 2:42 PMMattias Flodin
06/14/2022, 2:45 PMMattias Flodin
06/14/2022, 2:47 PMAdam Powell
06/14/2022, 2:47 PMAdam Powell
06/14/2022, 2:48 PMAdam Powell
06/14/2022, 2:49 PMMattias Flodin
06/14/2022, 2:53 PMMattias Flodin
06/14/2022, 2:55 PMAdam Powell
06/14/2022, 3:05 PMAdam Powell
06/14/2022, 3:06 PMdelay
or similar vs. suspended waiting on some aggregated result of several queries running in different coroutinesMattias Flodin
06/14/2022, 3:11 PMAdam Powell
06/14/2022, 3:12 PMAdam Powell
06/14/2022, 3:12 PMAdam Powell
06/14/2022, 3:14 PMMattias Flodin
06/14/2022, 3:19 PMAdam Powell
06/14/2022, 3:22 PMMattias Flodin
06/14/2022, 3:24 PMAdam Powell
06/14/2022, 3:26 PMMattias Flodin
06/14/2022, 3:28 PMAdam Powell
06/14/2022, 3:28 PMAdam Powell
06/14/2022, 3:28 PMAdam Powell
06/14/2022, 3:28 PMJoffrey
06/15/2022, 9:18 AMJoffrey
06/15/2022, 9:20 AMMattias Flodin
06/15/2022, 9:45 AMMarc Knaup
09/04/2022, 11:49 PMdelay
that supports sub-millisecond delays.
@Mattias Flodin basically said that would be my ideal scenario too:
Eventually execution enters a point when all coroutines that were started, including the top coroutine, are all suspended, all waiting for some query to finish. That’s when I want to fire off the batch to and subsequently release all the waiting continuations when the results come back.Calling
DataLoader.load(…)
makes it explicit that we’re waiting for something and once a batch is dispatched all loads are combined into one query.
@Adam Powell I don’t fully understand your point how layering makes this impractical or impossible.
What exactly is a layer? Are lower layers opaque to higher layers? Is there a good source to read about the architecture?
Is it not possible to wait for all execution within that scope to be suspended, then execute some logic (dispatch a batch, which adds another suspended execution), and only then allow all executions to resume again?
It doesn’t matter if a suspension is a query, delay, or anything else. “wait for all execution within that scope to be suspended” would just be the equivalent to Node.js’ end of currently event loop cycle and allowing the execution to resume equivalent to resuming the event loop.