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

Fix async worker return type #7249

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Conversation

pmconne
Copy link
Member

@pmconne pmconne commented Oct 9, 2024

Fixes #7248.

#7088 enabled support for asynchronous implementations of individual worker operations, to prevent long-running operations from blocking subsequent requests. But, the types did not accurately capture these semantics, so you couldn't return { result: T, transfer: Transferable[] } from async implementations without the compiler complaining. It would expect you to return { result: Promise<T>, transfer: Transferable[] } instead.

Adjusted the types to fix this.

@pmconne pmconne changed the title Pmc/fix async worker return type Fix async worker return type Oct 9, 2024
@pmconne pmconne enabled auto-merge (squash) October 9, 2024 13:40
@pmconne pmconne disabled auto-merge October 9, 2024 14:55
@pmconne pmconne merged commit e8139a9 into master Oct 9, 2024
12 of 14 checks passed
@pmconne pmconne deleted the pmc/fix-async-worker-return-type branch October 9, 2024 14:55
@mdastous-bentley
Copy link
Contributor

@aruniverse I would like to get it backported to 4.9.x

@aruniverse
Copy link
Member

@Mergifyio backport release/4.9.x

Copy link
Contributor

mergify bot commented Oct 9, 2024

backport release/4.9.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 9, 2024
pmconne added a commit that referenced this pull request Oct 9, 2024
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
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.

registerWorker typing does not allow async function returning a transferable struct
3 participants