Skip to content

feat: add basic channel implementation - #17

Merged
SeaRoll merged 4 commits into
masterfrom
feat-async-channels
Dec 24, 2025
Merged

feat: add basic channel implementation#17
SeaRoll merged 4 commits into
masterfrom
feat-async-channels

Conversation

@SeaRoll

@SeaRoll SeaRoll commented Dec 24, 2025

Copy link
Copy Markdown
Owner

No description provided.

@SeaRoll
SeaRoll requested a review from Copilot December 24, 2025 06:37

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 introduces a basic multi-producer, multi-consumer (MPMC) channel implementation for the async runtime, built on top of the heapless crate's MPMC queue. The implementation provides async send/recv operations along with synchronous try_send/try_recv alternatives.

Key changes:

  • Adds a new channels module with Producer and Consumer types supporting both blocking and non-blocking operations
  • Introduces channel! macro for convenient channel creation and spawn_task! macro for task spawning
  • Updates examples to use fully-qualified paths (e.g., ato::Spawner instead of importing Spawner)

Reviewed changes

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

Show a summary per file
File Description
src/lib.rs Exposes the new channels module and adds the spawn_task! macro for spawning tasks with a spawner
src/channels.rs Implements the channel infrastructure with Producer/Consumer types, async futures, and the channel! macro
examples/yield.rs Updates imports to use fully-qualified paths for Spawner and yield_now
examples/until_condition.rs Updates imports to use fully-qualified path for Spawner
examples/time.rs Updates imports to use fully-qualified paths for Spawner and sleep
examples/simple.rs Updates imports to use fully-qualified path for Spawner
examples/channels.rs Adds new example demonstrating channel usage with producer/consumer tasks

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

Comment thread src/channels.rs
Comment thread src/channels.rs
Comment thread src/channels.rs Outdated
Comment thread src/channels.rs Outdated
Comment thread src/lib.rs Outdated
@SeaRoll SeaRoll linked an issue Dec 24, 2025 that may be closed by this pull request
5 tasks
@SeaRoll
SeaRoll merged commit 7cc3ff8 into master Dec 24, 2025
4 checks passed
@SeaRoll
SeaRoll deleted the feat-async-channels branch December 24, 2025 06:53
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.

Channels

2 participants