next_line() doesn't need wait_for
param
This commit is contained in:
parent
423623fec1
commit
d837529698
1 changed files with 2 additions and 4 deletions
|
@ -100,8 +100,7 @@ class Server(IServer):
|
||||||
async def line_read(self, line: Line):
|
async def line_read(self, line: Line):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def next_line(self, wait_for: bool = False
|
async def next_line(self) -> Tuple[Line, List[Emit]]:
|
||||||
) -> Tuple[Line, List[Emit]]:
|
|
||||||
if self._read_queue:
|
if self._read_queue:
|
||||||
both = self._read_queue.popleft()
|
both = self._read_queue.popleft()
|
||||||
else:
|
else:
|
||||||
|
@ -119,10 +118,9 @@ class Server(IServer):
|
||||||
|
|
||||||
return both
|
return both
|
||||||
|
|
||||||
|
|
||||||
async def wait_for(self, response: IMatchResponse) -> Line:
|
async def wait_for(self, response: IMatchResponse) -> Line:
|
||||||
while True:
|
while True:
|
||||||
both = await self.next_line(wait_for=True)
|
both = await self.next_line()
|
||||||
line, emits = both
|
line, emits = both
|
||||||
|
|
||||||
if response.match(self, line):
|
if response.match(self, line):
|
||||||
|
|
Loading…
Reference in a new issue