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

refactor: adjust the fallback logic #2

Merged
merged 11 commits into from
Jan 11, 2025
Merged

Conversation

danieleloscozzese
Copy link
Collaborator

@danieleloscozzese danieleloscozzese commented Jan 11, 2025

requestIdleCallback was being misused here.
The type of tasks to be co-operatively scheduled in idle time are not the same type of task which can be queued with a rough priority.

Removes the fallback and uses timeouts directly.

Adds the queueMicrotask as a fallback for user-blocking tasks, since it yields and queues the callback with the highest priority (in the micro task and not macro task queue).

Remove the idle callback which was misused
Add a microtask alternative for user-blocking tasks
Align with the implementation details
@danieleloscozzese danieleloscozzese added the enhancement New feature or request label Jan 11, 2025
@danieleloscozzese danieleloscozzese self-assigned this Jan 11, 2025
@danieleloscozzese danieleloscozzese merged commit 3c524c2 into main Jan 11, 2025
1 check passed
@danieleloscozzese danieleloscozzese deleted the simplify-logic branch January 11, 2025 18:11
danieleloscozzese added a commit to danieleloscozzese/post-task that referenced this pull request Jan 12, 2025
Removes the Idle Callback fallback and uses timeouts directly.

Adds the queueMicrotask as a fallback for user-blocking tasks, since it yields and queues the callback with the highest priority (in the micro task and not macro task queue).
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

Successfully merging this pull request may close these issues.

1 participant