

def execute_task(key, task, data, queue, get_id, raise_on_exception=False):
    '\n    Compute task and handle all administration\n\n    See Also\n    --------\n    _execute_task - actually execute task\n    '
    try:
        result = _execute_task(task, data)
        id = get_id()
        result = (key, result, None, id)
    except Exception as e:
        if raise_on_exception:
            raise
        (exc_type, exc_value, exc_traceback) = sys.exc_info()
        tb = ''.join(traceback.format_tb(exc_traceback))
        result = (key, e, tb, None)
    try:
        queue.put(result)
    except Exception as e:
        if raise_on_exception:
            raise
        (exc_type, exc_value, exc_traceback) = sys.exc_info()
        tb = ''.join(traceback.format_tb(exc_traceback))
        queue.put((key, e, tb, None))

dataset/ETHPy150Open dask/dask/dask/async.py execute_task/original