11
11
from faststream .broker .publisher .usecase import PublisherUsecase
12
12
from faststream .broker .types import AsyncCallable , BrokerMiddleware , PublisherMiddleware
13
13
from faststream .exceptions import NOT_CONNECTED_YET
14
- from faststream .types import AsyncFunc , SendableMessage
14
+ from faststream .types import SendableMessage
15
15
16
16
17
17
class StompProducerPublishKwargs (TypedDict ):
@@ -77,8 +77,7 @@ async def publish(
77
77
) -> None :
78
78
assert self ._producer , NOT_CONNECTED_YET # noqa: S101
79
79
80
- call : AsyncFunc = self ._producer .publish
81
-
80
+ call = self ._producer .publish
82
81
for one_middleware in chain (
83
82
self ._middlewares [::- 1 ], # type: ignore[arg-type]
84
83
(
@@ -87,9 +86,8 @@ async def publish(
87
86
),
88
87
):
89
88
call = partial (one_middleware , call ) # type: ignore[operator, arg-type, misc]
90
- await self ._producer .publish (
91
- message = message , destination = self .destination , correlation_id = correlation_id , headers = headers or {}
92
- )
89
+
90
+ return await call (message , destination = self .destination , correlation_id = correlation_id , headers = headers or {})
93
91
94
92
async def request ( # type: ignore[override]
95
93
self , message : SendableMessage , * , correlation_id : str | None = None , headers : dict [str , str ] | None = None
0 commit comments