Skip to content

Conversation

@GordonSmith
Copy link
Owner

helpers

fixes #4

@GordonSmith GordonSmith requested a review from Copilot September 27, 2025 16:14
Copy link
Contributor

Copilot AI left a 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 = {});
Copy link

Copilot AI Sep 27, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a 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.

@codecov
Copy link

codecov bot commented Sep 27, 2025

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>
@GordonSmith GordonSmith merged commit 818a0c1 into trunk Sep 28, 2025
2 of 5 checks passed
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.

Implement canonical async runtime scaffolding

1 participant