tornado_opentracing/initialization.py
def _patch_handler_init(init, handler, args, kwargs):
    """
    This function patches tornado request handlers init method
    and then patches method that handle HTTP requests inside.
    This happens dynamically every time a request handler instace
    is created. This is needed as HTTP handler method do not exists
    on request handlers by default and are supposed to be added
    by users.

    TODO: check if patching __new__ would be better in any way.
    """
    init(*args, **kwargs)

    tracing = handler.settings.get("opentracing_tracing")
    if not tracing:
        return
    if not tracing._trace_all:
        return

    for method in handler.SUPPORTED_METHODS:
        handlers.wrap_method(handler, method.lower())

    This function patches tornado request handlers init method
    and then patches method that handle HTTP requests inside.
    This happens dynamically every time a request handler instace
    is created. This is needed as HTTP handler method do not exists
    on request handlers by default and are supposed to be added
    by users.

    TODO: check if patching __new__ would be better in any way.
    
This function patches tornado request handlers init method
and then patches method that handle HTTP requests inside.
This happens dynamically every time a request handler instace
is created. This is needed as HTTP handler method do not exists
on request handlers by default and are supposed to be added
by users.

check if patching __new__ would be better in any way.
This function patches tornado request handlers init method and then patches method that handle HTTP requests inside . This happens dynamically every time a request handler instace is created . This is needed as HTTP handler method do not exists on request handlers by default and are supposed to be added by users . check if patching __new__ would be better in any way .
def _patch_handler_init(init, handler, args, kwargs):
    init(*args, **kwargs)
    tracing = handler.settings.get("opentracing_tracing")
    if not tracing:
        return
    if not tracing._trace_all:
        return
    for method in handler.SUPPORTED_METHODS:
        handlers.wrap_method(handler, method.lower())
def _patch_handler_init ( init , handler , args , kwargs ) : init ( * args , ** kwargs ) tracing = handler . settings . get ( "opentracing_tracing" ) if not tracing : return if not tracing . _trace_all : return for method in handler . SUPPORTED_METHODS : handlers . wrap_method ( handler , method . lower ( ) )
This function patches tornado request handlers init method
and then patches method that handle HTTP requests inside.
This function patches tornado request handlers init method and then patches method that handle HTTP requests inside .
"""
    This function patches tornado request handlers init method
    and then patches method that handle HTTP requests inside.
    This happens dynamically every time a request handler instace
    is created. This is needed as HTTP handler method do not exists
    on request handlers by default and are supposed to be added
    by users.

    TODO: check if patching __new__ would be better in any way.
    """
init
handler
args
kwargs