def __init__(
self,
name: Annotated[
str,
Doc("RabbitMQ queue name."),
],
durable: Annotated[
bool,
Doc("Whether the object is durable."),
] = False,
exclusive: Annotated[
bool,
Doc(
"The queue can be used only in the current connection "
"and will be deleted after connection closed."
),
] = False,
passive: Annotated[
bool,
Doc("Do not create queue automatically."),
] = False,
auto_delete: Annotated[
bool,
Doc("The queue will be deleted after connection closed."),
] = False,
arguments: Annotated[
Optional["AnyDict"],
Doc(
"Queue declarationg arguments. "
"You can find information about them in the official RabbitMQ documentation: https://www.rabbitmq.com/docs/queues#optional-arguments"
),
] = None,
timeout: Annotated[
"TimeoutType",
Doc("Send confirmation time from RabbitMQ."),
] = None,
robust: Annotated[
bool,
Doc("Whether to declare queue object as restorable."),
] = True,
bind_arguments: Annotated[
Optional["AnyDict"],
Doc("Queue-exchange binding options."),
] = None,
routing_key: Annotated[
str,
Doc("Explicit binding routing key. Uses `name` if not presented."),
] = "",
) -> None:
re, routing_key = compile_path(
routing_key,
replace_symbol="*",
patch_regex=lambda x: x.replace(r"\#", ".+"),
)
super().__init__(name)
self.path_regex = re
self.durable = durable
self.exclusive = exclusive
self.bind_arguments = bind_arguments
self.routing_key = routing_key
self.robust = robust
self.passive = passive
self.auto_delete = auto_delete
self.arguments = arguments
self.timeout = timeout