(*args, **kwargs)
return outer
Return a threaded worker
Return a threaded worker
Return a threaded worker
def thread(*args, **kwargs):
    """
    Return a threaded worker
    """
    def outer(func, **kwargs):
        @functools.wraps(func)
        def inner(*args, **kwargs):
            # Run process in separate thread.
            logger.debug(f"new thread for function f{func} {args} {kwargs}")
            t = threading.Thread(target=func, args=args, kwargs=kwargs, daemon=True)
            t.start()

        # Gains an attribute called spool that runs the function in the background.
        inner.spool = inner
        inner.delay = inner
        return inner

    return outer
def thread ( * args , * * kwargs ) : def outer ( func , * * kwargs ) : @ functools . wraps ( func ) def inner ( * args , * * kwargs ) : # Run process in separate thread. logger . debug ( f"new thread for function f{func} {args} {kwargs}" ) t = threading . Thread ( target = func , args = args , kwargs = kwargs , daemon = True ) t . start ( ) # Gains an attribute called spool that runs the function in the background. inner . spool = inner inner . delay = inner return inner return outer