Telethon/telethon/network/requeststate.py

20 lines
659 B
Python
Raw Normal View History

import asyncio
class RequestState:
"""
This request state holds several information relevant to sent messages,
in particular the message ID assigned to the request, the container ID
it belongs to, the request itself, the request as bytes, and the future
result that will eventually be resolved.
"""
2018-10-19 17:53:50 +03:00
__slots__ = ('container_id', 'msg_id', 'request', 'data', 'future', 'after')
2018-10-19 17:53:50 +03:00
def __init__(self, request, loop, after=None):
self.container_id = None
self.msg_id = None
self.request = request
self.data = bytes(request)
self.future = asyncio.Future(loop=loop)
2018-10-19 17:53:50 +03:00
self.after = after