Skip to content

chore: various async fixes#527

Merged
lukewagner merged 7 commits into
WebAssembly:mainfrom
vados-cosmonic:chore=various-async-fixes
Jun 5, 2025
Merged

chore: various async fixes#527
lukewagner merged 7 commits into
WebAssembly:mainfrom
vados-cosmonic:chore=various-async-fixes

Conversation

@vados-cosmonic
Copy link
Copy Markdown
Collaborator

Stuff that I ran into as I was going through:

  • fetch -> from-stream
  • spacing changes
  • clarity around referenced WAT in separate sections

I think the call stack example needs to be made more approachable, but I don't know how to make it clearer -- I just wasn't able to wrap my mind around which parts were the component versus the host.

The concept that component-incoming async calls are Tasks and component-outgoing async calls are SubTasks which pair with a Task on the other side make sense. The additional wrinkle that when hosts call into components there is only a Task makes sense, but I couldn't make sense out of the following...

[Host caller] <- [Task] <- [Subtask+Task]* <- [Subtask] <- [Host callee]

I didn't put it in the PR but would like opinions on the following:

    [Host]
        ↓ calls component (host->component)
[Component Task]
        ↓ calls component (component -> component)
[Component Subtask <> Component Task]*
        ↓ calls host (component -> host)
 [Component Subtask]
        ↓ receives component call
[Host callee]

This comit adds some fixes/rewordings for the async sections.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Comment thread design/mvp/Async.md Outdated
Comment thread design/mvp/Async.md Outdated
Comment on lines +283 to +284
Based on this, the call stack for a component to host-defined import will be of
the general form:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this sentence is an improvement.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I can revert this -- I wasn't sure the "at any time" was necessary but it's hard to restate this, and I think the phrase "cal stack" was used too many times.

Maybe will be a callstack of the general form makes sense.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I've updated it, WDYT?

Comment thread design/mvp/Async.md Outdated
Comment thread design/mvp/Async.md Outdated
Comment thread design/mvp/Async.md
@lukewagner
Copy link
Copy Markdown
Member

I didn't put it in the PR but would like opinions on the following:

Good start, and I like the vertical format with annotations on the arrows. Riffing on it a bit, wdyt:

[Host]
  ↓ host calls component export
[Component Task]
  ↓ component calls import implemented by another component's export 0..N times
[Component Subtask <> Component Task]*
  ↓ component calls import implemented by the host
[Component Subtask <> Host task]

Co-authored-by: Luke Wagner <mail@lukewagner.name>
Comment thread design/mvp/Async.md Outdated
Copy link
Copy Markdown
Member

@lukewagner lukewagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, thanks. One suggestion:

Comment thread design/mvp/Async.md Outdated
Co-authored-by: Luke Wagner <mail@lukewagner.name>
@vados-cosmonic
Copy link
Copy Markdown
Collaborator Author

Thanks again for the close review @lukewagner !

@lukewagner lukewagner merged commit e5ef485 into WebAssembly:main Jun 5, 2025
1 check passed
@vados-cosmonic vados-cosmonic deleted the chore=various-async-fixes branch June 27, 2025 05:37
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