summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-06-19 15:14:05 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-06-19 15:14:05 (GMT)
commit037fa45a9fcc2579b9fa035b84b2baa0f7d3c432 (patch)
tree7488c4fec9772f6de2e91d4c0531db5e311796de /Lib/asyncio/base_events.py
parent63f277b6944d583596675970666bbf4152b83349 (diff)
parentd143209d7f82588c008de96b973b6306ccc69be0 (diff)
downloadcpython-037fa45a9fcc2579b9fa035b84b2baa0f7d3c432.zip
cpython-037fa45a9fcc2579b9fa035b84b2baa0f7d3c432.tar.gz
cpython-037fa45a9fcc2579b9fa035b84b2baa0f7d3c432.tar.bz2
(Merge 3.4) Tulip issue 83: document more asyncio functions in docstrings
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 5ee21d1..9350989 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -320,7 +320,7 @@ class BaseEventLoop(events.AbstractEventLoop):
"than the current one")
def call_soon_threadsafe(self, callback, *args):
- """XXX"""
+ """Like call_soon(), but thread safe."""
handle = self._call_soon(callback, args, check_loop=False)
self._write_to_self()
return handle
@@ -358,7 +358,17 @@ class BaseEventLoop(events.AbstractEventLoop):
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
- """XXX"""
+ """Connect to a TCP server.
+
+ Create a streaming transport connection to a given Internet host and
+ port: socket family AF_INET or socket.AF_INET6 depending on host (or
+ family if specified), socket type SOCK_STREAM. protocol_factory must be
+ a callable returning a protocol instance.
+
+ This method is a coroutine which will try to establish the connection
+ in the background. When successful, the coroutine returns a
+ (transport, protocol) pair.
+ """
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
@@ -557,7 +567,12 @@ class BaseEventLoop(events.AbstractEventLoop):
backlog=100,
ssl=None,
reuse_address=None):
- """XXX"""
+ """Create a TCP server bound to host and port.
+
+ Return an AbstractServer object which can be used to stop the service.
+
+ This method is a coroutine.
+ """
if isinstance(ssl, bool):
raise TypeError('ssl argument must be an SSLContext or None')
if host is not None or port is not None: