2018-09-29 13:20:26 +03:00
|
|
|
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-09-29 13:20:26 +03:00
|
|
|
|
2020-07-25 19:39:35 +03:00
|
|
|
def __init__(self, request, after=None):
|
2018-09-29 13:20:26 +03:00
|
|
|
self.container_id = None
|
|
|
|
self.msg_id = None
|
|
|
|
self.request = request
|
|
|
|
self.data = bytes(request)
|
2020-07-25 19:39:35 +03:00
|
|
|
self.future = asyncio.Future()
|
2018-10-19 17:53:50 +03:00
|
|
|
self.after = after
|