Skip to main content

apply_target

Apply function within pool context.

def apply_target(
target: callable,
args: tuple,
kwargs: dict,
callback: callable,
accept_callback: callable,
pid: int,
getpid: callable,
propagate: tuple,
monotonic: callable
) - > null

Apply function within pool context.

Parameters

NameTypeDescription
targetcallableThe function to be executed within the pool context.
argstuplePositional arguments to pass to the target function.
kwargsdictKeyword arguments to pass to the target function.
callbackcallableFunction invoked with the return value of the target function upon successful execution.
accept_callbackcallableOptional callback triggered when the task is accepted, receiving the process ID and a monotonic timestamp.
pidintThe process identifier to report; defaults to the current process ID if not provided.
getpidcallableFunction used to retrieve the current process ID.
propagatetupleA tuple of exception classes that should be allowed to propagate upward without being wrapped or handled.
monotoniccallableFunction used to retrieve a monotonic clock timestamp for timing and synchronization.

Returns

TypeDescription
nullThis function does not return a value; results are passed to the provided callback function.