Skip to content

task

Decorator to turn a function into a runnable task.

Parameters:

Name Type Description Default
function Callable

Any function you want to run as task. It should take a TaskInfo as first argument.

required
Source code in src/alchemical_queues/tasks/main.py
403
404
405
406
407
408
409
410
411
412
def task(
    function: Callable[Concatenate[TaskInfo, Param], RValue],
) -> Tasker[Param, RValue]:
    """Decorator to turn a function into a runnable task.

    Args:
        function (Callable): Any function you want to run as task. It should take a [TaskInfo][alchemical_queues.tasks.TaskInfo]
                             as first argument."""

    return Tasker[Param, RValue](function)