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

Named handlers extension #48

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dhil
Copy link
Member

@dhil dhil commented Sep 8, 2024

This patch implements a semantics for named handlers. It adds the following new types and instructions:

  • handler ts*
    • A new reference type for handler names.
  • resume_with $ct (on ...) : [ts1* (ref null $ct)] -> [ts2*]
    • where $ct ~~ func [ts1* (ref $handler)] -> [ts2*]
    • and $handler ~~ handler ts2*
    • Operationally, it works like resume, but with the small tweak that it generates and passes a unique name to the continuation.
  • suspend_to $handler $tag : [ts1* (ref null $handler)] -> [ts2*]
    • where $handler ~~ handler $ts3
    • and $tag ~~ func [ts1*] -> [ts2*]
    • It is similar to suspend, but rather than suspending to the nearest enclosing handler, it suspend to a particular given handler.

I've added a few tests too.

@dhil dhil force-pushed the wasmfx-named-handlers branch from f3c3bf5 to a08eebf Compare October 21, 2024 12:51
@dhil dhil mentioned this pull request Nov 4, 2024
3 tasks
@dhil dhil force-pushed the wasmfx-named-handlers branch from a08eebf to d9df8cd Compare December 3, 2024 13:48
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.

1 participant