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
68da8fc4
Kaydet (Commit)
68da8fc4
authored
Eyl 30, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22448: asyncio, cleanup _run_once(), only iterate once to remove delayed
calls that were cancelled.
üst
5083828d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
base_events.py
Lib/asyncio/base_events.py
+7
-4
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
68da8fc4
...
...
@@ -994,19 +994,22 @@ class BaseEventLoop(events.AbstractEventLoop):
'call_later' callbacks.
"""
# Remove delayed calls that were cancelled if their number is too high
sched_count
=
len
(
self
.
_scheduled
)
if
(
sched_count
>
_MIN_SCHEDULED_TIMER_HANDLES
and
self
.
_timer_cancelled_count
/
sched_count
>
_MIN_CANCELLED_TIMER_HANDLES_FRACTION
):
# Remove delayed calls that were cancelled if their number
# is too high
new_scheduled
=
[]
for
handle
in
self
.
_scheduled
:
if
handle
.
_cancelled
:
handle
.
_scheduled
=
False
else
:
new_scheduled
.
append
(
handle
)
self
.
_scheduled
=
[
x
for
x
in
self
.
_scheduled
if
not
x
.
_cancelled
]
heapq
.
heapify
(
new_scheduled
)
self
.
_scheduled
=
new_scheduled
self
.
_timer_cancelled_count
=
0
heapq
.
heapify
(
self
.
_scheduled
)
else
:
# Remove delayed calls that were cancelled from head of queue.
while
self
.
_scheduled
and
self
.
_scheduled
[
0
]
.
_cancelled
:
...
...
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