Context
The current asgi_middleware: Sequence[tuple[type, dict[str, Any]]] parameter is loose-typed and forces adopters to wrap functional middleware in a class just to fit the tuple shape.
Accept callable factories alongside the tuple form. Branch on isinstance(entry, tuple) in _apply_asgi_middleware.
Acceptance Criteria
Files
src/adcp/server/ (_apply_asgi_middleware)
Context
The current
asgi_middleware: Sequence[tuple[type, dict[str, Any]]]parameter is loose-typed and forces adopters to wrap functional middleware in a class just to fit the tuple shape.Accept callable factories alongside the tuple form. Branch on
isinstance(entry, tuple)in_apply_asgi_middleware.Acceptance Criteria
asgi_middlewareaccepts bothtuple[type, dict](current) andCallable[[ASGIApp], ASGIApp]factories_apply_asgi_middlewarebranches onisinstance(entry, tuple)Files
src/adcp/server/(_apply_asgi_middleware)