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
c0d062f5
Kaydet (Commit)
c0d062f5
authored
Haz 08, 2018
tarafından
Elvis Pranskevichus
Kaydeden (comit)
Yury Selivanov
Haz 08, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-33736: Improve the documentation of asyncio stream APIs (GH-7326)
üst
6860629d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
35 deletions
+75
-35
asyncio-eventloop.rst
Doc/library/asyncio-eventloop.rst
+2
-2
asyncio-stream.rst
Doc/library/asyncio-stream.rst
+67
-30
3.7.rst
Doc/whatsnew/3.7.rst
+4
-3
2018-06-01-12-27-40.bpo-33736.JVegIu.rst
...xt/Documentation/2018-06-01-12-27-40.bpo-33736.JVegIu.rst
+2
-0
No files found.
Doc/library/asyncio-eventloop.rst
Dosyayı görüntüle @
c0d062f5
...
@@ -445,7 +445,7 @@ Creating connections
...
@@ -445,7 +445,7 @@ Creating connections
.. versionchanged:: 3.7
.. versionchanged:: 3.7
The *path* parameter can now be a :
class:`~pathlib.Path` object
.
The *path* parameter can now be a :
term:`path-like object`
.
Creating listening connections
Creating listening connections
...
@@ -536,7 +536,7 @@ Creating listening connections
...
@@ -536,7 +536,7 @@ Creating listening connections
.. versionadded:: 3.7
.. versionadded:: 3.7
The *ssl_handshake_timeout*
parameter
.
The *ssl_handshake_timeout*
and *start_serving* parameters
.
.. versionchanged:: 3.7
.. versionchanged:: 3.7
...
...
Doc/library/asyncio-stream.rst
Dosyayı görüntüle @
c0d062f5
...
@@ -18,7 +18,7 @@ Stream functions
...
@@ -18,7 +18,7 @@ Stream functions
exactly what you want, feel free to copy their code.
exactly what you want, feel free to copy their code.
.. coroutinefunction:: open_connection(host=None, port=None, \*, loop=None, limit=None,
\*\*kwds
)
.. coroutinefunction:: open_connection(host=None, port=None, \*, loop=None, limit=None,
ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None, ssl_handshake_timeout=None
)
A wrapper for :meth:`~AbstractEventLoop.create_connection()` returning a (reader,
A wrapper for :meth:`~AbstractEventLoop.create_connection()` returning a (reader,
writer) pair.
writer) pair.
...
@@ -26,64 +26,102 @@ Stream functions
...
@@ -26,64 +26,102 @@ Stream functions
The reader returned is a :class:`StreamReader` instance; the writer is
The reader returned is a :class:`StreamReader` instance; the writer is
a :class:`StreamWriter` instance.
a :class:`StreamWriter` instance.
The arguments are all the usual arguments to
When specified, the *loop* argument determines which event loop to use,
:meth:`AbstractEventLoop.create_connection` except *protocol_factory*; most
and the *limit* argument determines the buffer size limit used by the
common are positional host and port, with various optional keyword arguments
returned :class:`StreamReader` instance.
following.
Additional optional keyword arguments are *loop* (to set the event loop
The rest of the arguments are passed directly to
instance to use) and *limit* (to set the buffer limit passed to the
:meth:`AbstractEventLoop.create_connection`.
:class:`StreamReader`).
This function is a :ref:`coroutine <coroutine>`.
This function is a :ref:`coroutine <coroutine>`.
.. coroutinefunction:: start_server(client_connected_cb, host=None, port=None, \*, loop=None, limit=None, \*\*kwds)
.. versionadded:: 3.7
The *ssl_handshake_timeout* parameter.
.. coroutinefunction:: start_server(client_connected_cb, host=None, port=None, \*, loop=None, limit=None, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None, reuse_port=None, ssl_handshake_timeout=None, start_serving=True)
Start a socket server, with a callback for each client connected. The return
Start a socket server, with a callback for each client connected. The return
value is the same as :meth:`~AbstractEventLoop.create_server()`.
value is the same as :meth:`~AbstractEventLoop.create_server()`.
The *client_connected_cb* parameter is called with two parameters:
The *client_connected_cb* callback is called whenever a new client
*client_reader*, *client_writer*. *client_reader* is a
connection is established. It receives a reader/writer pair as two
:class:`StreamReader` object, while *client_writer* is a
arguments, the first is a :class:`StreamReader` instance,
:class:`StreamWriter` object. The *client_connected_cb* parameter can
and the second is a :class:`StreamWriter` instance.
either be a plain callback function or a :ref:`coroutine function
<coroutine>`; if it is a coroutine function, it will be automatically
*client_connected_cb* accepts a plain callable or a
converted into a :class:`Task`.
:ref:`coroutine function <coroutine>`; if it is a coroutine function,
it will be automatically converted into a :class:`Task`.
The rest of the arguments are all the usual arguments to
When specified, the *loop* argument determines which event loop to use,
:meth:`~AbstractEventLoop.create_server()` except *protocol_factory*; most
and the *limit* argument determines the buffer size limit used by the
common are positional *host* and *port*, with various optional keyword
:class:`StreamReader` instance passed to *client_connected_cb*.
arguments following.
Additional optional keyword arguments are *loop* (to set the event loop
The rest of the arguments are passed directly to
instance to use) and *limit* (to set the buffer limit passed to the
:meth:`~AbstractEventLoop.create_server()`.
:class:`StreamReader`).
This function is a :ref:`coroutine <coroutine>`.
This function is a :ref:`coroutine <coroutine>`.
.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, limit=None, **kwds)
.. versionadded:: 3.7
The *ssl_handshake_timeout* and *start_serving* parameters.
.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, limit=None, ssl=None, sock=None, server_hostname=None, ssl_handshake_timeout=None)
A wrapper for :meth:`~AbstractEventLoop.create_unix_connection()` returning
A wrapper for :meth:`~AbstractEventLoop.create_unix_connection()` returning
a (reader, writer) pair.
a (reader, writer) pair.
See :func:`open_connection` for information about return value and other
When specified, the *loop* argument determines which event loop to use,
details.
and the *limit* argument determines the buffer size limit used by the
returned :class:`StreamReader` instance.
The rest of the arguments are passed directly to
:meth:`~AbstractEventLoop.create_unix_connection()`.
This function is a :ref:`coroutine <coroutine>`.
This function is a :ref:`coroutine <coroutine>`.
Availability: UNIX.
Availability: UNIX.
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \*, loop=None, limit=None, **kwds)
.. versionadded:: 3.7
The *ssl_handshake_timeout* parameter.
.. versionchanged:: 3.7
The *path* parameter can now be a :term:`path-like object`
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \*, loop=None, limit=None, sock=None, backlog=100, ssl=None, ssl_handshake_timeout=None, start_serving=True)
Start a UNIX Domain Socket server, with a callback for each client connected.
Start a UNIX Domain Socket server, with a callback for each client connected.
See :func:`start_server` for information about return value and other
The *client_connected_cb* callback is called whenever a new client
details.
connection is established. It receives a reader/writer pair as two
arguments, the first is a :class:`StreamReader` instance,
and the second is a :class:`StreamWriter` instance.
*client_connected_cb* accepts a plain callable or a
:ref:`coroutine function <coroutine>`; if it is a coroutine function,
it will be automatically converted into a :class:`Task`.
When specified, the *loop* argument determines which event loop to use,
and the *limit* argument determines the buffer size limit used by the
:class:`StreamReader` instance passed to *client_connected_cb*.
The rest of the arguments are passed directly to
:meth:`~AbstractEventLoop.create_unix_server()`.
This function is a :ref:`coroutine <coroutine>`.
This function is a :ref:`coroutine <coroutine>`.
Availability: UNIX.
Availability: UNIX.
.. versionadded:: 3.7
The *ssl_handshake_timeout* and *start_serving* parameters.
.. versionchanged:: 3.7
The *path* parameter can now be a :term:`path-like object`.
StreamReader
StreamReader
============
============
...
@@ -475,4 +513,3 @@ Coroutine waiting until a socket receives data using the
...
@@ -475,4 +513,3 @@ Coroutine waiting until a socket receives data using the
<asyncio-watch-read-event>` example uses the low-level
<asyncio-watch-read-event>` example uses the low-level
:meth:`AbstractEventLoop.add_reader` method to register the file descriptor of a
:meth:`AbstractEventLoop.add_reader` method to register the file descriptor of a
socket.
socket.
Doc/whatsnew/3.7.rst
Dosyayı görüntüle @
c0d062f5
...
@@ -699,11 +699,12 @@ include:
...
@@ -699,11 +699,12 @@ include:
gained support for Unix sockets.
gained support for Unix sockets.
(Contributed by Quentin Dawans in :issue:`31245`.)
(Contributed by Quentin Dawans in :issue:`31245`.)
* The :meth:`loop.create_connection() <asyncio.AbstractEventLoop.create_connection>`,
* The :func:`asyncio.open_connection`, :func:`asyncio.start_server` functions,
:meth:`loop.create_connection() <asyncio.AbstractEventLoop.create_connection>`,
:meth:`loop.create_server() <asyncio.AbstractEventLoop.create_server>`,
:meth:`loop.create_server() <asyncio.AbstractEventLoop.create_server>`,
:meth:`loop.create_unix_server() <asyncio.AbstractEventLoop.create_unix_server>`, and
:meth:`loop.create_accepted_socket() <asyncio.BaseEventLoop.connect_accepted_socket>`
:meth:`loop.create_accepted_socket() <asyncio.BaseEventLoop.connect_accepted_socket>`
now accept the *ssl_handshake_timeout* keyword argument.
methods and their corresponding UNIX socket variants now accept the
*ssl_handshake_timeout* keyword argument.
(Contributed by Neil Aspinall in :issue:`29970`.)
(Contributed by Neil Aspinall in :issue:`29970`.)
* The new :meth:`Handle.cancelled() <asyncio.Handle.cancelled>` method returns
* The new :meth:`Handle.cancelled() <asyncio.Handle.cancelled>` method returns
...
...
Misc/NEWS.d/next/Documentation/2018-06-01-12-27-40.bpo-33736.JVegIu.rst
0 → 100644
Dosyayı görüntüle @
c0d062f5
Improve the documentation of :func:`asyncio.open_connection`,
:func:`asyncio.start_server` and their UNIX socket counterparts.
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