Skip to content

feat(runtime): cancel & future combinator#665

Merged
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:feat/runtime/cancel-token
Feb 6, 2026
Merged

feat(runtime): cancel & future combinator#665
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:feat/runtime/cancel-token

Conversation

@George-Miao
Copy link
Member

@George-Miao George-Miao commented Feb 6, 2026

Closes #604

@George-Miao George-Miao self-assigned this Feb 6, 2026
@George-Miao George-Miao added the enhancement New feature or request label Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 01:00
@George-Miao George-Miao added the package: runtime Related to compio-runtime label Feb 6, 2026
@George-Miao George-Miao force-pushed the feat/runtime/cancel-token branch 2 times, most recently from 715d05c to e684e2a Compare February 6, 2026 01:04
@George-Miao George-Miao changed the title fear(runtime): cancel & future combinator feat(runtime): cancel & future combinator Feb 6, 2026
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 pull request adds cancellation support to the compio runtime through a new CancelToken API and future combinators. The implementation allows multiple operations to be cancelled together using a token, with both "fail-fast" and "fail-slow" cancellation modes.

Changes:

  • Introduces CancelToken for cancelling multiple operations at once
  • Adds with_cancel future combinator (requires future-combinator feature)
  • Refactors driver-level cancel API to accept references instead of owned values
  • Adds Runtime::current() and Runtime::try_current() helper methods

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
compio-runtime/src/cancel.rs New file implementing CancelToken and WaitFuture for coordinated cancellation
compio-runtime/src/future/cancel.rs New file implementing WithCancel and WithCancelFailFast future wrappers
compio-runtime/src/future/mod.rs Extends FutureExt trait with with_cancel method and adds cancel field to Ext
compio-runtime/src/runtime/future.rs Adds ContextExt trait and integrates cancel token registration in Submit::poll
compio-runtime/src/runtime/mod.rs Adds current(), try_current() methods and internal cancel token management methods
compio-runtime/src/lib.rs Exports CancelToken and conditionally exports future module
compio-driver/src/lib.rs Changes register_cancel to accept &Key<T> instead of Key<T>
compio-driver/src/cancel.rs Adds cancels method and optimizes duplicate registration handling
compio-driver/tests/file.rs Updates test to pass reference to register_cancel
compio-runtime/Cargo.toml Adds synchrony dependency for event handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@George-Miao George-Miao force-pushed the feat/runtime/cancel-token branch from e684e2a to 91cb404 Compare February 6, 2026 01:15
@George-Miao George-Miao requested a review from Berrysoft February 6, 2026 01:15
@George-Miao George-Miao force-pushed the feat/runtime/cancel-token branch from 91cb404 to 0a36532 Compare February 6, 2026 02:25
@George-Miao George-Miao merged commit 450d7ec into compio-rs:master Feb 6, 2026
54 checks passed
@George-Miao George-Miao deleted the feat/runtime/cancel-token branch February 6, 2026 18:24
@github-actions github-actions bot mentioned this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request package: runtime Related to compio-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: User-initiated Cancellation

2 participants