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
f9e49dd3
Kaydet (Commit)
f9e49dd3
authored
Haz 05, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tulip issue 83, Python issue #21252: Fill some XXX docstrings in asyncio
üst
1a170a74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
18 deletions
+29
-18
asyncio-eventloop.rst
Doc/library/asyncio-eventloop.rst
+4
-4
events.py
Lib/asyncio/events.py
+23
-12
unix_events.py
Lib/asyncio/unix_events.py
+2
-2
No files found.
Doc/library/asyncio-eventloop.rst
Dosyayı görüntüle @
f9e49dd3
...
...
@@ -64,19 +64,19 @@ An event loop policy must implement the following interface:
.. method:: get_event_loop()
Get the event loop for current context. Returns an event loop object
implementing :class:`BaseEventLoop` interface, or raises an exception in case
Get the event loop for
the
current context. Returns an event loop object
implementing
the
:class:`BaseEventLoop` interface, or raises an exception in case
no event loop has been set for the current context and the current policy
does not specify to create one. It should never return ``None``.
.. method:: set_event_loop(loop)
Set the event loop
of
the current context to *loop*.
Set the event loop
for
the current context to *loop*.
.. method:: new_event_loop()
Create and return a new event loop object according to this policy's rules.
If there's need to set this loop as the event loop
of
the current context,
If there's need to set this loop as the event loop
for
the current context,
:meth:`set_event_loop` must be called explicitly.
Access to the global loop policy
...
...
Lib/asyncio/events.py
Dosyayı görüntüle @
f9e49dd3
...
...
@@ -355,25 +355,33 @@ class AbstractEventLoopPolicy:
"""Abstract policy for accessing the event loop."""
def
get_event_loop
(
self
):
"""XXX"""
"""Get the event loop for the current context.
Returns an event loop object implementing the BaseEventLoop interface,
or raises an exception in case no event loop has been set for the
current context and the current policy does not specify to create one.
It should never return None."""
raise
NotImplementedError
def
set_event_loop
(
self
,
loop
):
"""
XXX
"""
"""
Set the event loop for the current context to loop.
"""
raise
NotImplementedError
def
new_event_loop
(
self
):
"""XXX"""
"""Create and return a new event loop object according to this
policy's rules. If there's need to set this loop as the event loop for
the current context, set_event_loop must be called explicitly."""
raise
NotImplementedError
# Child processes handling (Unix only).
def
get_child_watcher
(
self
):
"
""XXX""
"
"
Get the watcher for child processes.
"
raise
NotImplementedError
def
set_child_watcher
(
self
,
watcher
):
"""
XXX
"""
"""
Set the watcher for child processes.
"""
raise
NotImplementedError
...
...
@@ -447,39 +455,42 @@ def _init_event_loop_policy():
def
get_event_loop_policy
():
"""
XXX
"""
"""
Get the current event loop policy.
"""
if
_event_loop_policy
is
None
:
_init_event_loop_policy
()
return
_event_loop_policy
def
set_event_loop_policy
(
policy
):
"""XXX"""
"""Set the current event loop policy.
If policy is None, the default policy is restored."""
global
_event_loop_policy
assert
policy
is
None
or
isinstance
(
policy
,
AbstractEventLoopPolicy
)
_event_loop_policy
=
policy
def
get_event_loop
():
"""
XXX
"""
"""
Equivalent to calling get_event_loop_policy().get_event_loop().
"""
return
get_event_loop_policy
()
.
get_event_loop
()
def
set_event_loop
(
loop
):
"""
XXX
"""
"""
Equivalent to calling get_event_loop_policy().set_event_loop(loop).
"""
get_event_loop_policy
()
.
set_event_loop
(
loop
)
def
new_event_loop
():
"""
XXX
"""
"""
Equivalent to calling get_event_loop_policy().new_event_loop().
"""
return
get_event_loop_policy
()
.
new_event_loop
()
def
get_child_watcher
():
"""
XXX
"""
"""
Equivalent to calling get_event_loop_policy().get_child_watcher().
"""
return
get_event_loop_policy
()
.
get_child_watcher
()
def
set_child_watcher
(
watcher
):
"""XXX"""
"""Equivalent to calling
get_event_loop_policy().set_child_watcher(watcher)."""
return
get_event_loop_policy
()
.
set_child_watcher
(
watcher
)
Lib/asyncio/unix_events.py
Dosyayı görüntüle @
f9e49dd3
...
...
@@ -822,7 +822,7 @@ class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
self
.
_watcher
.
attach_loop
(
loop
)
def
get_child_watcher
(
self
):
"""Get the
child watcher
"""Get the
watcher for child processes.
If not yet set, a SafeChildWatcher object is automatically created.
"""
...
...
@@ -832,7 +832,7 @@ class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
return
self
.
_watcher
def
set_child_watcher
(
self
,
watcher
):
"""Set the
child watcher
"""
"""Set the
watcher for child processes.
"""
assert
watcher
is
None
or
isinstance
(
watcher
,
AbstractChildWatcher
)
...
...
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