Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ This repository contains a C++ ABI implementation of the WebAssembly Component M
- [x] F32
- [x] F64
- [x] Char
- [x] String
- [x] utf8 String
- [x] utf16 String
- [x] latin1+utf16 String
- [x] Strings (UTF-8, UTF-16, Latin-1+UTF-16)
- [x] List
- [x] Record
- [x] Tuple
Expand All @@ -46,6 +43,8 @@ This repository contains a C++ ABI implementation of the WebAssembly Component M
- [x] Option
- [x] Result
- [x] Flags
- [x] Streams (readable/writable)
- [x] Futures (readable/writable)
- [ ] Own
- [ ] Borrow

Expand Down Expand Up @@ -181,6 +180,8 @@ The canonical Component Model runtime is cooperative: hosts must drive pending w
- `FuncInst` is the callable signature hosts use to wrap guest functions.
- `Thread::create` builds a pending task with user-supplied readiness/resume callbacks.
- `Call::from_thread` returns a cancellation-capable handle to the caller.
- `Task` coordinates canonical backpressure, `canon_task.{return,cancel}`, and `canon_yield` helpers exposed through `context.hpp`.
- `canon_backpressure_{set,inc,dec}` update in-flight counters; most canonical entry points now guard `ComponentInstance::may_leave` before touching guest state.

Typical usage:

Expand Down Expand Up @@ -211,6 +212,10 @@ auto call = store.invoke(func, nullptr, [] { return std::vector<std::any>{}; },
store.tick();
```

### Waitables, streams, and futures

The canonical async ABI surfaces are implemented via `canon_waitable_*`, `canon_stream_*`, and `canon_future_*` helpers on `ComponentInstance`. Waitable sets can be joined to readable/writable stream ends or futures, and `canon_waitable_set_poll` reports readiness using the same event payload layout defined by the spec. See the doctests in `test/main.cpp` for end-to-end examples.

Call `tick()` in your host loop until all pending work completes. Cancellation is cooperative: calling `Call::request_cancellation()` marks the associated thread as cancelled before the next `tick()`.


Expand Down
Loading
Loading