@@ -74,11 +74,9 @@ def __init__(
7474 self ,
7575 * ,
7676 input_stream : EventPublisher [IE ],
77- output_stream_future : Future [EventReceiver [OE ]],
78- output_future : Future [O ],
77+ output_future : Future [tuple [O , EventReceiver [OE ]]],
7978 ) -> None :
8079 self .input_stream = input_stream
81- self ._output_stream_future = output_stream_future
8280 self ._output_future = output_future
8381
8482 async def await_response (self ) -> O :
@@ -93,7 +91,8 @@ async def await_response(self) -> O:
9391 :returns: The service's initial response.
9492 """
9593 if self .response is None :
96- self .response = await self ._output_future
94+ response , _ = await self .await_output ()
95+ return response
9796 return self .response
9897
9998 async def await_output_stream (self ) -> EventReceiver [OE ]:
@@ -108,7 +107,8 @@ async def await_output_stream(self) -> EventReceiver[OE]:
108107 :returns: The output stream.
109108 """
110109 if self .output_stream is None :
111- self .output_stream = await self ._output_stream_future
110+ _ , output_stream = await self .await_output ()
111+ return output_stream
112112 return self .output_stream
113113
114114 async def await_output (self ) -> tuple [O , EventReceiver [OE ]]:
@@ -130,7 +130,8 @@ async def await_output(self) -> tuple[O, EventReceiver[OE]]:
130130 :returns: A tuple containing the initial response and output stream. If the
131131 operation has no output stream, the second value will be None.
132132 """
133- return await self .await_response (), await self .await_output_stream ()
133+ self .response , self .output_stream = await self ._output_future
134+ return self .response , self .output_stream
134135
135136 async def close (self ) -> None :
136137 """Closes the event stream.
0 commit comments