Skip to main content

apply_target

Executes a target function with the provided arguments and keyword arguments, optionally handling callbacks and process ID retrieval through the base implementation.

def apply_target(
target: callable,
args: tuple,
kwargs: dict,
callback: callable,
accept_callback: callable,
getpid: callable
) - > Any

Executes a target function with the provided arguments and manages lifecycle callbacks for the resulting task.

Parameters

NameTypeDescription
targetcallableThe function or task to be executed.
argstuplePositional arguments to pass to the target function.
kwargsdictKeyword arguments to pass to the target function.
callbackcallableA function to be executed upon successful completion of the target.
accept_callbackcallableA function to be executed when the task is accepted for processing.
getpidcallableA callable that returns the process ID to associate with the task execution.

Returns

TypeDescription
AnyThe result of the underlying base application call, typically representing the task execution state.