mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Add disconnect method to sender
Unlike Rust, there's no implicit dropping of connections.
This commit is contained in:
parent
5a34e65708
commit
fb4503338d
|
@ -120,6 +120,10 @@ class Sender:
|
||||||
Enqueuer(request_queue),
|
Enqueuer(request_queue),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def disconnect(self):
|
||||||
|
self._writer.close()
|
||||||
|
await self._writer.wait_closed()
|
||||||
|
|
||||||
async def invoke(self, request: RemoteCall[Return]) -> bytes:
|
async def invoke(self, request: RemoteCall[Return]) -> bytes:
|
||||||
rx = self._enqueue_body(bytes(request))
|
rx = self._enqueue_body(bytes(request))
|
||||||
return await self._step_until_receive(rx)
|
return await self._step_until_receive(rx)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user