Skip to content

Commit

Permalink
chore: add wait closed placeholder
Browse files Browse the repository at this point in the history
This makes the compat server transport compatible with asyncio.
  • Loading branch information
joamag committed May 3, 2024
1 parent b3bd6af commit 473e395
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/netius/base/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ def serve_forever(self):
coroutine = self._serve_forever()
return asynchronous.coroutine_return(coroutine)

def wait_closed(self):
coroutine = self._wait_closed()
return asynchronous.coroutine_return(coroutine)

def is_serving(self):
return True

Expand Down Expand Up @@ -439,6 +443,11 @@ def _serve_forever(self):
future = self._loop.create_future()
yield future

def _wait_closed(self):
future = self._loop.create_future()
future.set_result(None)
yield future

def _aenter(self):
try:
future = self._loop.create_future()
Expand Down

0 comments on commit 473e395

Please sign in to comment.