fix: spawn → start_soon
https://anyio.readthedocs.io/en/stable/versionhistory.html v3.0.0 Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
eaa54db664
commit
63aa84b404
1 changed files with 3 additions and 3 deletions
|
@ -51,8 +51,8 @@ class Bot(IBot):
|
|||
async def _run_server(self, server: Server):
|
||||
try:
|
||||
async with anyio.create_task_group() as tg:
|
||||
await tg.spawn(server._read_lines)
|
||||
await tg.spawn(server._send_lines)
|
||||
tg.start_soon(server._read_lines)
|
||||
tg.start_soon(server._send_lines)
|
||||
except ServerDisconnectedException:
|
||||
server.disconnected = True
|
||||
|
||||
|
@ -62,4 +62,4 @@ class Bot(IBot):
|
|||
async with anyio.create_task_group() as tg:
|
||||
while not tg.cancel_scope.cancel_called:
|
||||
server = await self._server_queue.get()
|
||||
await tg.spawn(self._run_server, server)
|
||||
tg.start_soon(self._run_server, server)
|
||||
|
|
Loading…
Add table
Reference in a new issue