Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (#1539): correct anyio.create_memory_object_stream annotation #1541

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions faststream/rabbit/publisher/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
)

import anyio
from aio_pika.abc import AbstractIncomingMessage
from typing_extensions import override

from faststream.broker.publisher.proto import ProducerProto
Expand All @@ -24,8 +23,8 @@

import aiormq
from aio_pika import IncomingMessage, RobustQueue
from aio_pika.abc import DateType, HeadersType, TimeoutType
from anyio.streams.memory import MemoryObjectReceiveStream
from aio_pika.abc import AbstractIncomingMessage, DateType, HeadersType, TimeoutType
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream

from faststream.broker.types import (
AsyncCallable,
Expand Down Expand Up @@ -198,12 +197,13 @@ def __init__(self, lock: "anyio.Lock", callback_queue: "RobustQueue") -> None:
self.queue = callback_queue

async def __aenter__(self) -> "MemoryObjectReceiveStream[IncomingMessage]":
send_response_stream: MemoryObjectSendStream[AbstractIncomingMessage]
receive_response_stream: MemoryObjectReceiveStream[AbstractIncomingMessage]

(
send_response_stream,
receive_response_stream,
) = anyio.create_memory_object_stream[AbstractIncomingMessage](
max_buffer_size=1
)
) = anyio.create_memory_object_stream(max_buffer_size=1)
await self.lock.acquire()

self.consumer_tag = await self.queue.consume(
Expand Down
Loading