diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-01-13 08:49:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 13:49:28 +0000 |
commit | 10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f (patch) | |
tree | 1b97b98f60f33e690e9dcc4156ebafdd2617fe26 /synapse/federation/sender | |
parent | Fix typo in demo docs: differnt (#11735) (diff) | |
download | synapse-10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f.tar.xz |
Use auto_attribs/native type hints for attrs classes. (#11692)
Diffstat (limited to 'synapse/federation/sender')
-rw-r--r-- | synapse/federation/sender/per_destination_queue.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/federation/sender/per_destination_queue.py b/synapse/federation/sender/per_destination_queue.py index 391b30fbb5..8152e80b88 100644 --- a/synapse/federation/sender/per_destination_queue.py +++ b/synapse/federation/sender/per_destination_queue.py @@ -607,18 +607,18 @@ class PerDestinationQueue: self._pending_pdus = [] -@attr.s(slots=True) +@attr.s(slots=True, auto_attribs=True) class _TransactionQueueManager: """A helper async context manager for pulling stuff off the queues and tracking what was last successfully sent, etc. """ - queue = attr.ib(type=PerDestinationQueue) + queue: PerDestinationQueue - _device_stream_id = attr.ib(type=Optional[int], default=None) - _device_list_id = attr.ib(type=Optional[int], default=None) - _last_stream_ordering = attr.ib(type=Optional[int], default=None) - _pdus = attr.ib(type=List[EventBase], factory=list) + _device_stream_id: Optional[int] = None + _device_list_id: Optional[int] = None + _last_stream_ordering: Optional[int] = None + _pdus: List[EventBase] = attr.Factory(list) async def __aenter__(self) -> Tuple[List[EventBase], List[Edu]]: # First we calculate the EDUs we want to send, if any. |