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
52bb949f
Kaydet (Commit)
52bb949f
authored
Agu 25, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio, tulip issue 203: Add _FlowControlMixin.get_write_buffer_limits() method
üst
b261475a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
asyncio-protocol.rst
Doc/library/asyncio-protocol.rst
+12
-0
transports.py
Lib/asyncio/transports.py
+3
-0
test_transports.py
Lib/test/test_asyncio/test_transports.py
+2
-0
No files found.
Doc/library/asyncio-protocol.rst
Dosyayı görüntüle @
52bb949f
...
...
@@ -121,6 +121,16 @@ WriteTransport
Return the current size of the output buffer used by the transport.
.. method:: get_write_buffer_limits()
Get the *high*- and *low*-water limits for write flow control. Return a
tuple ``(low, high)`` where *low* and *high* are positive number of
bytes.
Use :meth:`set_write_buffer_limits` to set the limits.
.. versionadded:: 3.4.2
.. method:: set_write_buffer_limits(high=None, low=None)
Set the *high*- and *low*-water limits for write flow control.
...
...
@@ -141,6 +151,8 @@ WriteTransport
reduces opportunities for doing I/O and computation
concurrently.
Use :meth:`get_write_buffer_limits` to get the limits.
.. method:: write(data)
Write some *data* bytes to the transport.
...
...
Lib/asyncio/transports.py
Dosyayı görüntüle @
52bb949f
...
...
@@ -273,6 +273,9 @@ class _FlowControlMixin(Transport):
'protocol'
:
self
.
_protocol
,
})
def
get_write_buffer_limits
(
self
):
return
(
self
.
_low_water
,
self
.
_high_water
)
def
_set_write_buffer_limits
(
self
,
high
=
None
,
low
=
None
):
if
high
is
None
:
if
low
is
None
:
...
...
Lib/test/test_asyncio/test_transports.py
Dosyayı görüntüle @
52bb949f
...
...
@@ -79,9 +79,11 @@ class TransportTests(unittest.TestCase):
transport
.
set_write_buffer_limits
(
high
=
1024
,
low
=
128
)
self
.
assertFalse
(
transport
.
_protocol_paused
)
self
.
assertEqual
(
transport
.
get_write_buffer_limits
(),
(
128
,
1024
))
transport
.
set_write_buffer_limits
(
high
=
256
,
low
=
128
)
self
.
assertTrue
(
transport
.
_protocol_paused
)
self
.
assertEqual
(
transport
.
get_write_buffer_limits
(),
(
128
,
256
))
if
__name__
==
'__main__'
:
...
...
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