asyncio doc: move AbstractServer to the event loop page

Add also entries in the table of content for each synchronization primitive
class.
This commit is contained in:
Victor Stinner 2014-01-24 18:11:43 +01:00
parent c3bf14d1eb
commit 8c462c5a80
3 changed files with 43 additions and 16 deletions

View File

@ -344,6 +344,22 @@ pool of processes). By default, an event loop uses a thread pool executor
Set the default executor used by :meth:`run_in_executor`. Set the default executor used by :meth:`run_in_executor`.
Server
------
.. class:: AbstractServer
Abstract server returned by :func:`BaseEventLoop.create_server`.
.. method:: close()
Stop serving. This leaves existing connections open.
.. method:: wait_closed()
Coroutine to wait until service is closed.
.. _asyncio-hello-world-callback: .. _asyncio-hello-world-callback:
Example: Hello World (callback) Example: Hello World (callback)

View File

@ -415,22 +415,6 @@ coroutine with ``yield from``. For example, the :meth:`StreamWriter.drain`
coroutine can be used to wait until the write buffer is flushed. coroutine can be used to wait until the write buffer is flushed.
Server
------
.. class:: AbstractServer
Abstract server returned by :func:`BaseEventLoop.create_server`.
.. method:: close()
Stop serving. This leaves existing connections open.
.. method:: wait_closed()
Coroutine to wait until service is closed.
Protocol example: TCP echo server and client Protocol example: TCP echo server and client
============================================ ============================================

View File

@ -7,6 +7,9 @@ Synchronization primitives
Locks Locks
----- -----
Lock
^^^^
.. class:: Lock(\*, loop=None) .. class:: Lock(\*, loop=None)
Primitive lock objects. Primitive lock objects.
@ -85,6 +88,9 @@ Locks
There is no return value. There is no return value.
Event
^^^^^
.. class:: Event(\*, loop=None) .. class:: Event(\*, loop=None)
An Event implementation, asynchronous equivalent to :class:`threading.Event`. An Event implementation, asynchronous equivalent to :class:`threading.Event`.
@ -121,6 +127,9 @@ Locks
This method returns a :ref:`coroutine object <coroutine>`. This method returns a :ref:`coroutine object <coroutine>`.
Condition
^^^^^^^^^
.. class:: Condition(\*, loop=None) .. class:: Condition(\*, loop=None)
A Condition implementation, asynchronous equivalent to A Condition implementation, asynchronous equivalent to
@ -181,6 +190,9 @@ Locks
Semaphores Semaphores
---------- ----------
Semaphore
^^^^^^^^^
.. class:: Semaphore(value=1, \*, loop=None) .. class:: Semaphore(value=1, \*, loop=None)
A Semaphore implementation. A Semaphore implementation.
@ -218,6 +230,9 @@ Semaphores
larger than zero again, wake up that coroutine. larger than zero again, wake up that coroutine.
BoundedSemaphore
^^^^^^^^^^^^^^^^
.. class:: BoundedSemaphore(value=1, \*, loop=None) .. class:: BoundedSemaphore(value=1, \*, loop=None)
A bounded semaphore implementation. Inherit from :class:`Semaphore`. A bounded semaphore implementation. Inherit from :class:`Semaphore`.
@ -229,6 +244,9 @@ Semaphores
Queues Queues
------ ------
Queue
^^^^^
.. class:: Queue(maxsize=0, \*, loop=None) .. class:: Queue(maxsize=0, \*, loop=None)
A queue, useful for coordinating producer and consumer coroutines. A queue, useful for coordinating producer and consumer coroutines.
@ -294,6 +312,9 @@ Queues
Number of items allowed in the queue. Number of items allowed in the queue.
PriorityQueue
^^^^^^^^^^^^^
.. class:: PriorityQueue .. class:: PriorityQueue
A subclass of :class:`Queue`; retrieves entries in priority order (lowest A subclass of :class:`Queue`; retrieves entries in priority order (lowest
@ -302,12 +323,18 @@ Queues
Entries are typically tuples of the form: (priority number, data). Entries are typically tuples of the form: (priority number, data).
LifoQueue
^^^^^^^^^
.. class:: LifoQueue .. class:: LifoQueue
A subclass of :class:`Queue` that retrieves most recently added entries A subclass of :class:`Queue` that retrieves most recently added entries
first. first.
JoinableQueue
^^^^^^^^^^^^^
.. class:: JoinableQueue .. class:: JoinableQueue
A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join` A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join`