Skip to content

feat: add better macro ergonomics + run once - #16

Merged
SeaRoll merged 3 commits into
masterfrom
macro-ergo
Dec 21, 2025
Merged

feat: add better macro ergonomics + run once#16
SeaRoll merged 3 commits into
masterfrom
macro-ergo

Conversation

@SeaRoll

@SeaRoll SeaRoll commented Dec 21, 2025

Copy link
Copy Markdown
Owner

No description provided.

@SeaRoll
SeaRoll requested a review from Copilot December 21, 2025 15:49

Copilot AI left a comment

Copy link
Copy Markdown

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 enhances the ATO async runtime with improved macro ergonomics and a new run_once method for more flexible task execution. The changes introduce a TaskHandle wrapper type and redesign the task! macro to provide a more intuitive API.

Key changes:

  • Introduced TaskHandle<'a> struct to wrap pinned futures, simplifying the spawning API
  • Redesigned task! macro with named binding syntax for better ergonomics
  • Added run_once() method to Spawner for executing single tasks on demand

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib.rs Core library changes: added TaskHandle struct, updated spawn() to accept TaskHandle, redesigned task! macro with new syntax, and implemented run_once() method
examples/yield.rs Updated to use new task! macro syntax with named bindings
examples/until_condition.rs New example demonstrating run_once() usage in a loop-based execution pattern
examples/time.rs Updated to use new task! macro syntax
examples/simple.rs Updated to use new task! macro syntax and simplified task message
README.md Updated documentation to reflect new API usage and version bump to 2.0.1
Cargo.toml Version bump from 2.0.0 to 2.0.1

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

Comment thread src/lib.rs Outdated
Comment thread src/lib.rs
Comment thread src/lib.rs
@SeaRoll
SeaRoll merged commit 75b1517 into master Dec 21, 2025
4 checks passed
@SeaRoll
SeaRoll deleted the macro-ergo branch December 21, 2025 15:55
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