summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py3
-rw-r--r--Lib/asyncio/events.py4
2 files changed, 7 insertions, 0 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 00831b3..ab00231 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -185,6 +185,9 @@ class Server(events.AbstractServer):
if self._active_count == 0:
self._wakeup()
+ def get_loop(self):
+ return self._loop
+
def _wakeup(self):
waiters = self._waiters
self._waiters = None
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index 9496d5c..731a0c5 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -155,6 +155,10 @@ class AbstractServer:
"""Coroutine to wait until service is closed."""
return NotImplemented
+ def get_loop(self):
+ """ Get the event loop the Server object is attached to."""
+ return NotImplemented
+
class AbstractEventLoop:
"""Abstract event loop."""