Skip to content

refactor: adjust the fallback logic#2

Merged
danieleloscozzese merged 11 commits intomainfrom
simplify-logic
Jan 11, 2025
Merged

refactor: adjust the fallback logic#2
danieleloscozzese merged 11 commits intomainfrom
simplify-logic

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