Browse Source

Clarify use of context-locals with signals.

pull/475/merge
Ron DuPlain 13 years ago
parent
commit
492ef06bff
  1. 13
      docs/signals.rst

13
docs/signals.rst

@ -131,6 +131,8 @@ debugging. You can access the name of the signal with the
missing blinker installations, you can do so by using the
:class:`flask.signals.Namespace` class.
.. _signals-sending:
Sending Signals
---------------
@ -156,6 +158,17 @@ function, you can pass ``current_app._get_current_object()`` as sender.
that :data:`~flask.current_app` is a proxy and not the real application
object.
Signals and Flask's Request Context
-----------------------------------
Signals fully support :ref:`reqcontext` when receiving signals. Context-local
variables are consistently available between :data:`~flask.request_started` and
:data:`~flask.request_finished`, so you can rely on :class:`flask.g` and others
as needed. Note the limitations described in :ref:`signals-sending` and the
:data:`~flask.request_tearing_down` signal.
Decorator Based Signal Subscriptions
------------------------------------

Loading…
Cancel
Save