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
62511fd6
Kaydet (Commit)
62511fd6
authored
Haz 22, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: document the debug mode
üst
1580fe3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
7 deletions
+30
-7
asyncio-dev.rst
Doc/library/asyncio-dev.rst
+27
-4
asyncio-eventloop.rst
Doc/library/asyncio-eventloop.rst
+1
-1
cmdline.rst
Doc/using/cmdline.rst
+2
-2
No files found.
Doc/library/asyncio-dev.rst
Dosyayı görüntüle @
62511fd6
...
@@ -9,6 +9,29 @@ Asynchronous programming is different than classical "sequential" programming.
...
@@ -9,6 +9,29 @@ Asynchronous programming is different than classical "sequential" programming.
This page lists common traps and explains how to avoid them.
This page lists common traps and explains how to avoid them.
.. _asyncio-debug-mode:
Debug mode of asyncio
---------------------
To enable the debug mode globally, set the environment variable
:envvar:`PYTHONASYNCIODEBUG` to ``1``. Examples of effects of the debug mode:
* Log :ref:`coroutines defined but never "yielded from"
<asyncio-coroutine-not-scheduled>`
* :meth:`~BaseEventLoop.call_soon` and :meth:`~BaseEventLoop.call_at` methods
raise an exception if they are called from the wrong thread.
* Log the execution time of the selector
* Log callbacks taking more than 100 ms to be executed. The
:attr:`BaseEventLoop.slow_callback_duration` attribute is the minimum
duration in seconds of "slow" callbacks.
.. seealso::
The :meth:`BaseEventLoop.set_debug` method and the :ref:`asyncio logger
<asyncio-logger>`.
.. _asyncio-multithreading:
.. _asyncio-multithreading:
Concurrency and multithreading
Concurrency and multithreading
...
@@ -83,10 +106,10 @@ Detect coroutine objects never scheduled
...
@@ -83,10 +106,10 @@ Detect coroutine objects never scheduled
When a coroutine function is called but not passed to :func:`async` or to the
When a coroutine function is called but not passed to :func:`async` or to the
:class:`Task` constructor, it is not scheduled and it is probably a bug.
:class:`Task` constructor, it is not scheduled and it is probably a bug.
To detect such bug,
set the environment variable :envvar:`PYTHONASYNCIODEBUG`
To detect such bug,
:ref:`enable the debug mode of asyncio
to ``1``. When the coroutine object is destroyed by the garbage collector, a
<asyncio-debug-mode>`. When the coroutine object is destroyed by the garbage
log will be emitted with the traceback where the coroutine function was called.
collector, a log will be emitted with the traceback where the coroutine
See the :ref:`asyncio logger <asyncio-logger>`.
function was called.
See the :ref:`asyncio logger <asyncio-logger>`.
The debug flag changes the behaviour of the :func:`coroutine` decorator. The
The debug flag changes the behaviour of the :func:`coroutine` decorator. The
debug flag value is only used when then coroutine function is defined, not when
debug flag value is only used when then coroutine function is defined, not when
...
...
Doc/library/asyncio-eventloop.rst
Dosyayı görüntüle @
62511fd6
...
@@ -601,7 +601,7 @@ Debug mode
...
@@ -601,7 +601,7 @@ Debug mode
.. seealso::
.. seealso::
The :ref:`
Develop with asyncio <asyncio-dev>` section
.
The :ref:`
debug mode of asyncio <asyncio-debug-mode>`
.
Server
Server
...
...
Doc/using/cmdline.rst
Dosyayı görüntüle @
62511fd6
...
@@ -616,8 +616,8 @@ conflict.
...
@@ -616,8 +616,8 @@ conflict.
.. envvar:: PYTHONASYNCIODEBUG
.. envvar:: PYTHONASYNCIODEBUG
If this environment variable is set to a non-empty string, enable the
debug
If this environment variable is set to a non-empty string, enable the
mode
of the :mod:`asyncio` module.
:ref:`debug mode <asyncio-debug-mode>`
of the :mod:`asyncio` module.
.. versionadded:: 3.4
.. versionadded:: 3.4
...
...
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