-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add async runtime #5
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds async runtime support to the WebAssembly Component Model C++ library, providing cooperative task scheduling functionality. The implementation includes a Store for managing pending work, Thread objects for async operations, and a Call interface for cancellation support.
Key changes:
- Implementation of async runtime components (
Store,Thread,Call,FuncInst) with cooperative scheduling - Comprehensive test coverage for both successful execution and cancellation scenarios
- Documentation updates explaining usage patterns for the new async functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
include/cmcpp/runtime.hpp |
Complete async runtime implementation with Store, Thread, and Call classes |
include/cmcpp.hpp |
Adds runtime.hpp include to main header |
test/main.cpp |
Comprehensive test case covering async execution and cancellation |
README.md |
Documentation and usage examples for the new async runtime |
| using ResumeFn = std::function<bool(bool)>; | ||
| using CancelFn = std::function<void()>; | ||
|
|
||
| static std::shared_ptr<Thread> create(Store &store, ReadyFn ready, ResumeFn resume, bool cancellable = false, CancelFn on_cancel = {}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The parameter order places the boolean cancellable before the optional on_cancel function. Consider moving cancellable to the end or making it part of the CancelFn presence check to improve API usability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
helpers fixes #4 Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
helpers
fixes #4