Skip to content

Feat/message send router#106

Merged
jackburridge merged 2 commits into
mainfrom
feat/message-send-router
Apr 18, 2026
Merged

Feat/message send router#106
jackburridge merged 2 commits into
mainfrom
feat/message-send-router

Conversation

@jackburridge
Copy link
Copy Markdown
Contributor

Add AsyncFast message send router

Description

Summary

This PR adds reusable routing support for AsyncFast message send operations and refactors channel routing to share the same underlying route-matching logic.

Changes

  • Extracts address pattern matching into a generic Router utility.
  • Refactors channel dispatch to use ChannelRouter, keeping channel resolution behavior centralized.
  • Moves ChannelNotFoundError into shared routing utilities so it can be used by both receive and send routing.
  • Adds MessageSendRouter, an async context manager that routes message.send events to different send backends based on event address.
  • Supports a default message sender for unmatched routes.
  • Adds documentation and an example showing mixed outbound routing to Kafka and SQS.
  • Adds tests for channel routing refactor coverage and message send router behavior.

Why

AsyncFast already supports address-based routing for inbound channels, but outbound message sends previously had to be wired to a single send backend. This makes it possible to route different outgoing message types to different AMGI send implementations while preserving lifecycle management through async context managers.

Testing

  • Added tests for MessageSendRouter default routing.
  • Added tests for explicit address-pattern routing.
  • Updated channel tests for the new explicit parameter passing path.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jackburridge jackburridge force-pushed the feat/message-send-router branch 2 times, most recently from 701f3d0 to d2f23cf Compare April 18, 2026 10:00
@jackburridge jackburridge force-pushed the feat/message-send-router branch from d2f23cf to af457ca Compare April 18, 2026 10:14
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 AsyncFast | 🛠️ Build #32316941 | 📁 Comparing af457ca against latest (42352a9)

  🔍 Preview build  

1 files changed
+ message_send_router.html

@jackburridge jackburridge merged commit 95fa697 into main Apr 18, 2026
7 checks passed
@jackburridge jackburridge deleted the feat/message-send-router branch April 18, 2026 10:59
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.

1 participant