Skip to content

Use scheduler.postTask when implementing EM_TIMING_SETIMMEDIATE#26985

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:postTask
May 21, 2026
Merged

Use scheduler.postTask when implementing EM_TIMING_SETIMMEDIATE#26985
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:postTask

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented May 20, 2026

IIUC this API is better than setTimeout(0) or postMessage() in terms of being a polyfill for the old/deprecated setImmediate API.

Its not clear if/when safari will implement this API so it will likely need to be feature detected for the foreseeable.

@sbc100 sbc100 requested a review from dschuff May 20, 2026 21:33
@sbc100 sbc100 changed the title Use Scheduler.postTask when implementing EM_TIMING_SETIMMEDIATE Use scheduler.postTask when implementing EM_TIMING_SETIMMEDIATE May 20, 2026
@sbc100 sbc100 enabled auto-merge (squash) May 20, 2026 22:34
IIUC this API is better than `setTimeout(0)` or `postMessage()` in terms
of being a polyfill for the old/deprecated setImmediate API.

Its not clear if/when safari will implement this API so it will likely
need to be feature detected for the foreseeable.
@sbc100 sbc100 disabled auto-merge May 21, 2026 16:41
@sbc100 sbc100 merged commit 1666285 into emscripten-core:main May 21, 2026
28 of 30 checks passed
@sbc100 sbc100 deleted the postTask branch May 21, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants