Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0c924b83
Kaydet (Commit)
0c924b83
authored
Ara 02, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: sort some methods
üst
b09f9b33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
76 deletions
+84
-76
asyncio.rst
Doc/library/asyncio.rst
+84
-76
No files found.
Doc/library/asyncio.rst
Dosyayı görüntüle @
0c924b83
...
...
@@ -367,7 +367,7 @@ Running subprocesses
Run subprocesses asynchronously using the :mod:`subprocess` module.
.. method:: BaseEventLoop.subprocess_
shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=Tru
e, bufsize=0, \*\*kwargs)
.. method:: BaseEventLoop.subprocess_
exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=Fals
e, bufsize=0, \*\*kwargs)
XXX
...
...
@@ -375,7 +375,7 @@ Run subprocesses asynchronously using the :mod:`subprocess` module.
See the constructor of the :class:`subprocess.Popen` class for parameters.
.. method:: BaseEventLoop.subprocess_
exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=Fals
e, bufsize=0, \*\*kwargs)
.. method:: BaseEventLoop.subprocess_
shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=Tru
e, bufsize=0, \*\*kwargs)
XXX
...
...
@@ -978,29 +978,9 @@ Stream reader and writer
Transport.
.. method:: write(data)
XXX
.. method:: writelines(data)
XXX
.. method:: write_eof()
XXX
.. method:: can_write_eof()
XXX
.. method:: close()
XXX
.. method:: get_extra_info(name, default=None)
XXX
Close the transport: see :meth:`BaseTransport.close`.
.. method:: drain()
...
...
@@ -1018,20 +998,37 @@ Stream reader and writer
that Future is completed, which will happen when the buffer is
(partially) drained and the protocol is resumed.
.. method:: get_extra_info(name, default=None)
.. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None)
Return optional transport information: see
:meth:`BaseTransport.get_extra_info`.
.. method::
exception(
)
.. method::
write(data
)
Get the exception.
Write some *data* bytes to the transport: see
:meth:`WriteTransport.write`.
.. method::
set_exception(exc
)
.. method::
writelines(data
)
Set the exception.
Write a list (or any iterable) of data bytes to the transport:
see :meth:`WriteTransport.writelines`.
.. method::
set_transport(transport
)
.. method::
can_write_eof(
)
Set the transport.
Return :const:`True` if the transport supports :meth:`write_eof`,
:const:`False` if not. See :meth:`WriteTransport.can_write_eof`.
.. method:: write_eof()
Close the write end of the transport after flushing buffered data:
see :meth:`WriteTransport.write_eof`.
.. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None)
.. method:: exception()
Get the exception.
.. method:: feed_eof()
...
...
@@ -1041,19 +1038,27 @@ Stream reader and writer
XXX
.. method:: set_exception(exc)
Set the exception.
.. method:: set_transport(transport)
Set the transport.
.. method:: read(n=-1)
XXX
This method returns a :ref:`coroutine <coroutine>`.
.. method:: read
exactly(n
)
.. method:: read
line(
)
XXX
This method returns a :ref:`coroutine <coroutine>`.
.. method:: read
line(
)
.. method:: read
exactly(n
)
XXX
...
...
@@ -1222,6 +1227,12 @@ Synchronization primitives
method. The :meth:`wait` method blocks until the flag is true. The flag is
initially false.
.. method:: clear()
Reset the internal flag to false. Subsequently, coroutines calling
:meth:`wait` will block until :meth:`set` is called to set the internal
flag to true again.
.. method:: is_set()
Return ``True`` if and only if the internal flag is true.
...
...
@@ -1232,12 +1243,6 @@ Synchronization primitives
true are awakened. Coroutine that call :meth:`wait` once the flag is true
will not block at all.
.. method:: clear()
Reset the internal flag to false. Subsequently, coroutines calling
:meth:`wait` will block until :meth:`set` is called to set the internal
flag to true again.
.. method:: wait()
Block until the internal flag is true.
...
...
@@ -1260,6 +1265,28 @@ Synchronization primitives
A new :class:`Lock` object is created and used as the underlying lock.
.. method:: notify(n=1)
By default, wake up one coroutine waiting on this condition, if any.
If the calling coroutine has not acquired the lock when this method is
called, a :exc:`RuntimeError` is raised.
This method wakes up at most *n* of the coroutines waiting for the
condition variable; it is a no-op if no coroutines are waiting.
.. note::
An awakened coroutine does not actually return from its :meth:`wait`
call until it can reacquire the lock. Since :meth:`notify` does not
release the lock, its caller should.
.. method:: notify_all()
Wake up all threads waiting on this condition. This method acts like
:meth:`notify`, but wakes up all waiting threads instead of one. If the
calling thread has not acquired the lock when this method is called, a
:exc:`RuntimeError` is raised.
.. method:: wait()
Wait until notified.
...
...
@@ -1283,28 +1310,6 @@ Synchronization primitives
This method returns a :ref:`coroutine <coroutine>`.
.. method:: notify(n=1)
By default, wake up one coroutine waiting on this condition, if any.
If the calling coroutine has not acquired the lock when this method is
called, a :exc:`RuntimeError` is raised.
This method wakes up at most *n* of the coroutines waiting for the
condition variable; it is a no-op if no coroutines are waiting.
.. note::
An awakened coroutine does not actually return from its :meth:`wait`
call until it can reacquire the lock. Since :meth:`notify` does not
release the lock, its caller should.
.. method:: notify_all()
Wake up all threads waiting on this condition. This method acts like
:meth:`notify`, but wakes up all waiting threads instead of one. If the
calling thread has not acquired the lock when this method is called, a
:exc:`RuntimeError` is raised.
.. class:: Semaphore(value=1, \*, loop=None)
...
...
@@ -1321,10 +1326,6 @@ Synchronization primitives
defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError`
is raised.
.. method:: locked()
Returns ``True`` if semaphore can not be acquired immediately.
.. method:: acquire()
Acquire a semaphore.
...
...
@@ -1336,6 +1337,10 @@ Synchronization primitives
This method returns a :ref:`coroutine <coroutine>`.
.. method:: locked()
Returns ``True`` if semaphore can not be acquired immediately.
.. method:: release()
Release a semaphore, incrementing the internal counter by one. When it
...
...
@@ -1415,6 +1420,7 @@ Synchronization primitives
Number of items allowed in the queue.
.. class:: PriorityQueue
A subclass of :class:`Queue`; retrieves entries in priority order (lowest
...
...
@@ -1422,16 +1428,30 @@ Synchronization primitives
Entries are typically tuples of the form: (priority number, data).
.. class:: LifoQueue
A subclass of :class:`Queue` that retrieves most recently added entries
first.
.. class:: JoinableQueue
A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join`
methods.
.. method:: join()
Block until all items in the queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer thread calls
:meth:`task_done` to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks drops to zero,
:meth:`join` unblocks.
This method returns a :ref:`coroutine <coroutine>`.
.. method:: task_done()
Indicate that a formerly enqueued task is complete.
...
...
@@ -1447,18 +1467,6 @@ Synchronization primitives
Raises :exc:`ValueError` if called more times than there were items
placed in the queue.
.. method:: join()
Block until all items in the queue have been gotten and processed.
The count of unfinished tasks goes up whenever an item is added to the
queue. The count goes down whenever a consumer thread calls
:meth:`task_done` to indicate that the item was retrieved and all work on
it is complete. When the count of unfinished tasks drops to zero,
:meth:`join` unblocks.
This method returns a :ref:`coroutine <coroutine>`.
Examples
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment