-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: There is a pattern of using `runInLoop()` with `thisIteration=true` to schedule a callback as late as possible in the loop and use it to batch-flush operations that were deferred by other callbacks. This pattern may not behave as intended with `loopCallbacksTimeslice` because the scheduled callback is not guaranteed anymore to run within the same iteration. This diff adds first-class support for the pattern with `runAfterLoop()` (symmetrical to `runBeforeLoop()`), which is guaranteed to run after the `runInLoop()` callbacks (so no rescheduling hacks needed), and is not subject to the timeslice (so it must be used with care). It nicely complements `loopCallbacksTimeslice` for the aforementioned flush pattern, since it is possible to bound how long operations are deferred (modulo individually long-running callbacks). Differential Revision: D58610940 fbshipit-source-id: ac7ba212f18fc3750d42242daf6ba699cdb5db87
- Loading branch information
1 parent
553668b
commit 7e04ec7
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters