Deleted unused timeout logic
parent
a6e921548b
commit
18e4352faf
|
@ -178,9 +178,6 @@ async def open_jsonrpc_session(
|
||||||
request_type: Optional[type] = None,
|
request_type: Optional[type] = None,
|
||||||
request_hook: Optional[Callable] = None,
|
request_hook: Optional[Callable] = None,
|
||||||
error_hook: Optional[Callable] = None,
|
error_hook: Optional[Callable] = None,
|
||||||
timeout: int = 5,
|
|
||||||
timeout_hook: Optional[Callable] = None,
|
|
||||||
timeout_args: list = [],
|
|
||||||
) -> Callable[[str, dict], dict]:
|
) -> Callable[[str, dict], dict]:
|
||||||
|
|
||||||
async with (
|
async with (
|
||||||
|
@ -226,9 +223,8 @@ async def open_jsonrpc_session(
|
||||||
receives every ws message and stores it in its corresponding result
|
receives every ws message and stores it in its corresponding result
|
||||||
field, then sets the event to wakeup original sender tasks.
|
field, then sets the event to wakeup original sender tasks.
|
||||||
also recieves responses to requests originated from the server side.
|
also recieves responses to requests originated from the server side.
|
||||||
reconnects the tasks after timeout.
|
|
||||||
'''
|
'''
|
||||||
with trio.move_on_after(timeout) as cancel_scope:
|
|
||||||
async for msg in ws:
|
async for msg in ws:
|
||||||
match msg:
|
match msg:
|
||||||
case {
|
case {
|
||||||
|
@ -263,12 +259,6 @@ async def open_jsonrpc_session(
|
||||||
case _:
|
case _:
|
||||||
log.warning(f'Unhandled JSON-RPC msg!?\n{msg}')
|
log.warning(f'Unhandled JSON-RPC msg!?\n{msg}')
|
||||||
|
|
||||||
if cancel_scope.cancelled_caught:
|
|
||||||
await ws._connect()
|
|
||||||
n.start_soon(recv_task)
|
|
||||||
if timeout_hook:
|
|
||||||
n.start_soon(timeout_hook, json_rpc, *timeout_args)
|
|
||||||
|
|
||||||
|
|
||||||
n.start_soon(recv_task)
|
n.start_soon(recv_task)
|
||||||
yield json_rpc
|
yield json_rpc
|
||||||
|
|
Loading…
Reference in New Issue