Skip to content

Commit

Permalink
Add Server.get_loop()
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Jun 4, 2018
1 parent 622ed9c commit 6a42f84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ async def start_server_sock():
loop=self.loop,
sock=sock)

self.assertIs(srv.get_loop(), self.loop)

srv_socks = srv.sockets
self.assertTrue(srv_socks)

Expand Down
3 changes: 3 additions & 0 deletions uvloop/server.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ cdef class Server:
def __repr__(self):
return '<%s sockets=%r>' % (self.__class__.__name__, self.sockets)

def get_loop(self):
return self._loop

@cython.iterable_coroutine
async def wait_closed(self):
if self._waiters is None:
Expand Down

0 comments on commit 6a42f84

Please sign in to comment.