Skip to content

feat(amgi): switch message protocol to per-message scope#100

Merged
jackburridge merged 1 commit into
mainfrom
feat/amgi-v2-per-message
Feb 18, 2026
Merged

feat(amgi): switch message protocol to per-message scope#100
jackburridge merged 1 commit into
mainfrom
feat/amgi-v2-per-message

Conversation

@jackburridge
Copy link
Copy Markdown
Contributor

@jackburridge jackburridge commented Feb 18, 2026

This simplifies AMGI message protocol, it is now simplified to one call per message

async def app(scope, receive, send):
    if scope["type"] == "message":
        message = await receive()
        try:
            headers = message["headers"]
            payload = message.get("payload")
            bindings = message.get("bindings", {})
            ...  # Do some message handling here!
            await send(
                {
                    "type": "message.ack",
                }
            )
        except Exception as e:
            await send(
                {
                    "type": "message.nack",
                    "message": str(e),
                }
            )
    else:
        pass  # Handle other types

This should simplify the creation of middleware, allowing for easy implementation of tracing etc.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 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/amgi-v2-per-message branch from 23d6dfe to 24ec069 Compare February 18, 2026 20:22
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Feb 18, 2026

Documentation build overview

📚 AMGI | 🛠️ Build #31466247 | 📁 Comparing 5305fa2 against latest (7eeadc4)


🔍 Preview build

Show files changed (4 files in total): 📝 4 modified | ➕ 0 added | ➖ 0 deleted
File Status
extensions.html 📝 modified
specifications.html 📝 modified
specifications/lifespan.html 📝 modified
specifications/message.html 📝 modified

@jackburridge jackburridge force-pushed the feat/amgi-v2-per-message branch 2 times, most recently from f1b3eaa to 6e3d3a6 Compare February 18, 2026 20:51
to simplify the protocol it has been switched to a per message call

BREAKING CHANGE:
@jackburridge jackburridge force-pushed the feat/amgi-v2-per-message branch from 6e3d3a6 to 5305fa2 Compare February 18, 2026 21:31
@jackburridge jackburridge merged commit bc52d37 into main Feb 18, 2026
7 checks passed
@jackburridge jackburridge deleted the feat/amgi-v2-per-message branch February 18, 2026 21:50
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