chore: rename parameter to avoid naming collision
This commit is contained in:
@@ -58,7 +58,7 @@ async def channel_broadcaster(channel: WebSocketChannel, message_stream: Message
|
|||||||
" consumers."
|
" consumers."
|
||||||
)
|
)
|
||||||
|
|
||||||
await channel.send(message, timeout=True)
|
await channel.send(message, use_timeout=True)
|
||||||
|
|
||||||
|
|
||||||
async def _process_consumer_request(request: Dict[str, Any], channel: WebSocketChannel, rpc: RPC):
|
async def _process_consumer_request(request: Dict[str, Any], channel: WebSocketChannel, rpc: RPC):
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class WebSocketChannel:
|
|||||||
self._send_high_limit = min(max(self.avg_send_time * 2, 1), 3)
|
self._send_high_limit = min(max(self.avg_send_time * 2, 1), 3)
|
||||||
|
|
||||||
async def send(
|
async def send(
|
||||||
self, message: Union[WSMessageSchemaType, Dict[str, Any]], timeout: bool = False
|
self, message: Union[WSMessageSchemaType, Dict[str, Any]], use_timeout: bool = False
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Send a message on the wrapped websocket. If the sending
|
Send a message on the wrapped websocket. If the sending
|
||||||
@@ -88,7 +88,7 @@ class WebSocketChannel:
|
|||||||
disconnect the connection.
|
disconnect the connection.
|
||||||
|
|
||||||
:param message: The message to send
|
:param message: The message to send
|
||||||
:param timeout: Enforce send high limit, defaults to False
|
:param use_timeout: Enforce send high limit, defaults to False
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
_ = time.time()
|
_ = time.time()
|
||||||
@@ -96,7 +96,8 @@ class WebSocketChannel:
|
|||||||
# a TimeoutError and bubble up to the
|
# a TimeoutError and bubble up to the
|
||||||
# message_endpoint to close the connection
|
# message_endpoint to close the connection
|
||||||
await asyncio.wait_for(
|
await asyncio.wait_for(
|
||||||
self._wrapped_ws.send(message), timeout=self._send_high_limit if timeout else None
|
self._wrapped_ws.send(message),
|
||||||
|
timeout=self._send_high_limit if use_timeout else None,
|
||||||
)
|
)
|
||||||
total_time = time.time() - _
|
total_time = time.time() - _
|
||||||
self._send_times.append(total_time)
|
self._send_times.append(total_time)
|
||||||
|
|||||||
Reference in New Issue
Block a user