Skip to content

Commit

Permalink
add type annotations for RabbitQueue and enum for queue type
Browse files Browse the repository at this point in the history
  • Loading branch information
pepellsd committed Dec 21, 2024
1 parent 684ef1a commit 10df170
Show file tree
Hide file tree
Showing 14 changed files with 292 additions and 53 deletions.
10 changes: 10 additions & 0 deletions docs/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,7 @@ search:
- [ExchangeType](api/faststream/rabbit/schemas/ExchangeType.md)
- [RabbitExchange](api/faststream/rabbit/schemas/RabbitExchange.md)
- [RabbitQueue](api/faststream/rabbit/schemas/RabbitQueue.md)
- [RabbitQueueType](api/faststream/rabbit/schemas/RabbitQueueType.md)
- [ReplyConfig](api/faststream/rabbit/schemas/ReplyConfig.md)
- constants
- [ExchangeType](api/faststream/rabbit/schemas/constants/ExchangeType.md)
Expand All @@ -942,7 +943,16 @@ search:
- proto
- [BaseRMQInformation](api/faststream/rabbit/schemas/proto/BaseRMQInformation.md)
- queue
- [ClassicQueueArgs](api/faststream/rabbit/schemas/queue/ClassicQueueArgs.md)
- [CommonQueueArgs](api/faststream/rabbit/schemas/queue/CommonQueueArgs.md)
- [QueueClassicTypeSpecificArgs](api/faststream/rabbit/schemas/queue/QueueClassicTypeSpecificArgs.md)
- [QueueQuorumTypeSpecificArgs](api/faststream/rabbit/schemas/queue/QueueQuorumTypeSpecificArgs.md)
- [QueueStreamTypeSpecificArgs](api/faststream/rabbit/schemas/queue/QueueStreamTypeSpecificArgs.md)
- [QuorumQueueArgs](api/faststream/rabbit/schemas/queue/QuorumQueueArgs.md)
- [RabbitQueue](api/faststream/rabbit/schemas/queue/RabbitQueue.md)
- [RabbitQueueType](api/faststream/rabbit/schemas/queue/RabbitQueueType.md)
- [SharedQueueClassicAndQuorumArgs](api/faststream/rabbit/schemas/queue/SharedQueueClassicAndQuorumArgs.md)
- [StreamQueueArgs](api/faststream/rabbit/schemas/queue/StreamQueueArgs.md)
- reply
- [ReplyConfig](api/faststream/rabbit/schemas/reply/ReplyConfig.md)
- security
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/en/api/faststream/rabbit/schemas/RabbitQueueType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.RabbitQueueType
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.ClassicQueueArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.CommonQueueArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.QueueClassicTypeSpecificArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.QueueQuorumTypeSpecificArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.QueueStreamTypeSpecificArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.QuorumQueueArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.RabbitQueueType
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.SharedQueueClassicAndQuorumArgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# 0.5 - API
# 2 - Release
# 3 - Contributing
# 5 - Template Page
# 10 - Default
search:
boost: 0.5
---

::: faststream.rabbit.schemas.queue.StreamQueueArgs
3 changes: 2 additions & 1 deletion faststream/rabbit/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
RABBIT_REPLY,
RabbitExchange,
RabbitQueue,
RabbitQueueType,
)
from faststream.rabbit.security import parse_security
from faststream.rabbit.subscriber.asyncapi import AsyncAPISubscriber
Expand Down Expand Up @@ -475,7 +476,7 @@ async def _connect( # type: ignore[override]
if max_consumers:
c = AsyncAPISubscriber.build_log_context(
None,
RabbitQueue(""),
RabbitQueue("", queue_type=RabbitQueueType.Classic),
RabbitExchange(""),
)
self._log(f"Set max consumers to {max_consumers}", extra=c)
Expand Down
7 changes: 5 additions & 2 deletions faststream/rabbit/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from faststream.rabbit.schemas.constants import ExchangeType
from faststream.rabbit.schemas.exchange import RabbitExchange
from faststream.rabbit.schemas.proto import BaseRMQInformation
from faststream.rabbit.schemas.queue import RabbitQueue
from faststream.rabbit.schemas.queue import RabbitQueue, RabbitQueueType
from faststream.rabbit.schemas.reply import ReplyConfig

__all__ = (
Expand All @@ -10,7 +10,10 @@
"ExchangeType",
"RabbitExchange",
"RabbitQueue",
"RabbitQueueType",
"ReplyConfig",
)

RABBIT_REPLY = RabbitQueue("amq.rabbitmq.reply-to", passive=True)
RABBIT_REPLY = RabbitQueue(
"amq.rabbitmq.reply-to", passive=True, queue_type=RabbitQueueType.Classic
)
Loading

0 comments on commit 10df170

Please sign in to comment.