Skip to content

WIP: simplify DefineMiddleware, Middleware - #393

Open
devkral wants to merge 2 commits into
mainfrom
devkral/idea/more_flexible_middleware
Open

devkral wants to merge 2 commits into
mainfrom
devkral/idea/more_flexible_middleware

Conversation

@devkral

@devkral devkral commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • The code has 100% test coverage.
  • The documentation was properly created or updated (if applicable) following the correct guidelines and appropriate language.
  • I branched out from the latest main or is a sub-branch.

Summary or description

This idea makes DefineMiddleware more compatible to other asgi frameworks.
By not using app as keyword but as positional argument we can use DefineMiddleware as decorator.

However it will probably break a lot, so just see it as a suggestion.

This idea makes DefineMiddleware more compatible to other asgi
frameworks.
By not using app as keyword but as positional argument we can use
DefineMiddleware as decorator.

However it will probably break a lot, so just see it as a suggestion,
@codspeed

codspeed Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing devkral/idea/more_flexible_middleware (295eb7b) with main (0261563)

Open in CodSpeed

@devkral

devkral commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

do you like the idea? Shall I pursue it? We might need to update ravyn too.

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