Skip to content

Commit 8a0cd59

Browse files
authored
Add faststream compatibility (#168)
1 parent 7d8cf41 commit 8a0cd59

File tree

1 file changed

+4
-3
lines changed
  • packages/faststream-stomp/faststream_stomp

1 file changed

+4
-3
lines changed

packages/faststream-stomp/faststream_stomp/broker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import anyio
99
import stompman
1010
from fast_depends.dependencies import Dependant
11-
from faststream import ContextRepo, PublishType
11+
from faststream import BaseMiddleware, ContextRepo, PublishType
1212
from faststream._internal.basic_types import LoggerProto, SendableMessage
1313
from faststream._internal.broker import BrokerUsecase
1414
from faststream._internal.broker.registrator import Registrator
@@ -47,7 +47,8 @@ def _handle_listen_task_done(listen_task: asyncio.Task[None]) -> None:
4747
except asyncio.CancelledError:
4848
return
4949
if isinstance(task_exception, ExceptionGroup) and isinstance(
50-
task_exception.exceptions[0], stompman.FailedAllConnectAttemptsError
50+
task_exception.exceptions[0],
51+
stompman.FailedAllConnectAttemptsError,
5152
):
5253
raise SystemExit(1)
5354

@@ -94,7 +95,7 @@ def __init__(
9495
decoder: CustomCallable | None = None,
9596
parser: CustomCallable | None = None,
9697
dependencies: Iterable[Dependant] = (),
97-
middlewares: Sequence[BrokerMiddleware[stompman.MessageFrame, StompPublishCommand]] = (),
98+
middlewares: Sequence[type[BaseMiddleware] | BrokerMiddleware[stompman.MessageFrame, StompPublishCommand]] = (),
9899
graceful_timeout: float | None = 15.0,
99100
routers: Sequence[Registrator[stompman.MessageFrame]] = (),
100101
# Logging args

0 commit comments

Comments
 (0)