await server.send() should block until it hits the wire

This commit is contained in:
jesopo 2020-04-02 23:53:32 +01:00
parent 8dde7b7216
commit b34e4fcc22
2 changed files with 23 additions and 13 deletions

View file

@ -1,5 +1,6 @@
from typing import Awaitable, Iterable, List, Optional
from enum import IntEnum
from asyncio import Future
from typing import Awaitable, Iterable, List, Optional
from enum import IntEnum
from ircstates import Server
from irctokens import Line
@ -13,11 +14,12 @@ class SendPriority(IntEnum):
LOW = 20
DEFAULT = MEDIUM
class PriorityLine(object):
class SentLine(object):
def __init__(self, priority: int, line: Line):
self.priority = priority
self.line = line
def __lt__(self, other: "PriorityLine") -> bool:
self.priority = priority
self.line = line
self.future: Future = Future()
def __lt__(self, other: "SentLine") -> bool:
return self.priority < other.priority
class ICapability(object):