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
03179ef3
Kaydet (Commit)
03179ef3
authored
Eyl 15, 2016
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge heads
üst
47e7062f
0a91d484
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
base_events.py
Lib/asyncio/base_events.py
+16
-8
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
03179ef3
...
@@ -242,9 +242,13 @@ class BaseEventLoop(events.AbstractEventLoop):
...
@@ -242,9 +242,13 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_task_factory
=
None
self
.
_task_factory
=
None
self
.
_coroutine_wrapper_set
=
False
self
.
_coroutine_wrapper_set
=
False
# A weak set of all asynchronous generators that are being iterated
if
hasattr
(
sys
,
'get_asyncgen_hooks'
):
# by the loop.
# Python >= 3.6
self
.
_asyncgens
=
weakref
.
WeakSet
()
# A weak set of all asynchronous generators that are
# being iterated by the loop.
self
.
_asyncgens
=
weakref
.
WeakSet
()
else
:
self
.
_asyncgens
=
None
# Set to True when `loop.shutdown_asyncgens` is called.
# Set to True when `loop.shutdown_asyncgens` is called.
self
.
_asyncgens_shutdown_called
=
False
self
.
_asyncgens_shutdown_called
=
False
...
@@ -359,7 +363,9 @@ class BaseEventLoop(events.AbstractEventLoop):
...
@@ -359,7 +363,9 @@ class BaseEventLoop(events.AbstractEventLoop):
"""Shutdown all active asynchronous generators."""
"""Shutdown all active asynchronous generators."""
self
.
_asyncgens_shutdown_called
=
True
self
.
_asyncgens_shutdown_called
=
True
if
not
len
(
self
.
_asyncgens
):
if
self
.
_asyncgens
is
None
or
not
len
(
self
.
_asyncgens
):
# If Python version is <3.6 or we don't have any asynchronous
# generators alive.
return
return
closing_agens
=
list
(
self
.
_asyncgens
)
closing_agens
=
list
(
self
.
_asyncgens
)
...
@@ -387,9 +393,10 @@ class BaseEventLoop(events.AbstractEventLoop):
...
@@ -387,9 +393,10 @@ class BaseEventLoop(events.AbstractEventLoop):
raise
RuntimeError
(
'Event loop is running.'
)
raise
RuntimeError
(
'Event loop is running.'
)
self
.
_set_coroutine_wrapper
(
self
.
_debug
)
self
.
_set_coroutine_wrapper
(
self
.
_debug
)
self
.
_thread_id
=
threading
.
get_ident
()
self
.
_thread_id
=
threading
.
get_ident
()
old_agen_hooks
=
sys
.
get_asyncgen_hooks
()
if
self
.
_asyncgens
is
not
None
:
sys
.
set_asyncgen_hooks
(
firstiter
=
self
.
_asyncgen_firstiter_hook
,
old_agen_hooks
=
sys
.
get_asyncgen_hooks
()
finalizer
=
self
.
_asyncgen_finalizer_hook
)
sys
.
set_asyncgen_hooks
(
firstiter
=
self
.
_asyncgen_firstiter_hook
,
finalizer
=
self
.
_asyncgen_finalizer_hook
)
try
:
try
:
while
True
:
while
True
:
self
.
_run_once
()
self
.
_run_once
()
...
@@ -399,7 +406,8 @@ class BaseEventLoop(events.AbstractEventLoop):
...
@@ -399,7 +406,8 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_stopping
=
False
self
.
_stopping
=
False
self
.
_thread_id
=
None
self
.
_thread_id
=
None
self
.
_set_coroutine_wrapper
(
False
)
self
.
_set_coroutine_wrapper
(
False
)
sys
.
set_asyncgen_hooks
(
*
old_agen_hooks
)
if
self
.
_asyncgens
is
not
None
:
sys
.
set_asyncgen_hooks
(
*
old_agen_hooks
)
def
run_until_complete
(
self
,
future
):
def
run_until_complete
(
self
,
future
):
"""Run until the Future is done.
"""Run until the Future is done.
...
...
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