arboretum/utils.py
def process_worker(fn):
    """ Decorator to run function as a process

    TODO(arl): would be good to have option for QThread signals
    """
    @wraps(fn)
    def _process(*args, **kwargs):

        def _worker(*args, **kwargs):
            q = args[0]
            r = fn(*args[1:], **kwargs)
            q.put(r)

        queue = SimpleQueue()
        process = Process(target=_worker, args=(queue, *args), kwargs=kwargs)
        process.start()
        result = queue.get()
        process.join()

        return result

    return _process
 Decorator to run function as a process

    TODO(arl): would be good to have option for QThread signals
    
Decorator to run function as a process
TODO(arl): would be good to have option for QThread signals
Decorator to run function as a process TODO ( arl ) : would be good to have option for QThread signals
def process_worker(fn):
    @wraps(fn)
    def _process(*args, **kwargs):
        def _worker(*args, **kwargs):
            q = args[0]
            r = fn(*args[1:], **kwargs)
            q.put(r)
        queue = SimpleQueue()
        process = Process(target=_worker, args=(queue, *args), kwargs=kwargs)
        process.start()
        result = queue.get()
        process.join()
        return result
    return _process
def process_worker ( fn ) : @ wraps ( fn ) def _process ( * args , ** kwargs ) : def _worker ( * args , ** kwargs ) : q = args [ 0 ] r = fn ( * args [ 1 : ] , ** kwargs ) q . put ( r ) queue = SimpleQueue ( ) process = Process ( target = _worker , args = ( queue , * args ) , kwargs = kwargs ) process . start ( ) result = queue . get ( ) process . join ( ) return result return _process
Decorator to run function as a process
TODO(arl): would be good to have option for QThread signals
Decorator to run function as a process TODO ( arl ) : would be good to have option for QThread signals
""" Decorator to run function as a process

    TODO(arl): would be good to have option for QThread signals
    """
fn