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

[FEATURE REQUEST] Add microtask / queueMicrotask support #11

Open
tungs opened this issue Feb 22, 2022 · 0 comments
Open

[FEATURE REQUEST] Add microtask / queueMicrotask support #11

tungs opened this issue Feb 22, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tungs
Copy link
Owner

tungs commented Feb 22, 2022

Is your feature request related to a problem? Please describe.
Currently microtasks aren't considered when iterating through time. Timeweb currently iterates through time in a loop, which doesn't allow for queued microtasks to run.

Describe the solution you'd like
It may be useful if processNextBlock used recursive calls to queueMicrotask, so if any of the functions run with setTimeout/setInterval that queue microtasks would run before the next iteration timeouts/intervals. Also it's worth considering whether other sequential parts of timeweb should relinquish to microtasks (events, requestAnimationFrame)

Describe alternatives you've considered
None.

More Considerations
Microtasks may also be useful when trying to save webgl canvas data before it becomes stale, though I'm not sure about hte lifecycle of canvas data.

Additional context
queueMicrotask API
Guide to Microtasks

@tungs tungs added the enhancement New feature or request label Feb 22, 2022
@tungs tungs self-assigned this Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant