]> git.ipfire.org Git - thirdparty/tornado.git/commit
Make StackContext more usable in libraries by reducing the need to
authorBen Darnell <ben@bendarnell.com>
Fri, 24 Sep 2010 18:42:33 +0000 (11:42 -0700)
committerBen Darnell <ben@bendarnell.com>
Fri, 24 Sep 2010 18:42:33 +0000 (11:42 -0700)
commit7a7e24143e77481d140fb5579bc67e4c45cbcfad
treed4d2cbf8b9133c49aaf93262d3dd03733277e0cb
parent4973e296ebd68bdaf5bd7fc51186b56c6c69bc91
Make StackContext more usable in libraries by reducing the need to
explicitly use IOLoop.add_callback or NullContext.

This change also simplifies and codifies the ordering behavior of
StackContext:  When a wrapped callback is executed, the innermost
StackContexts are those that were active when the callback was
wrapped.  Additional StackContexts (possibly including other copies
of the same contexts) may be present in outer levels of the stack, but
since the role of most StackContexts is to catch exceptions this should
not have any effect.

Backwards compatibility note:  StackContexts that do something other than
catch exceptions may need to be modified to be reentrant.
tornado/stack_context.py
tornado/test/stack_context_test.py