AsynchronousExecutor

AsynchronousExecutor#

NAME#

Kernel::System::AsynchronousExecutor - base class to delegate tasks to the OTRS Scheduler Daemon

DESCRIPTION#

ObjectManager controlled modules can add this base class to execute some time consuming tasks in the background using the separate process OTRS Scheduler Daemon.

PUBLIC INTERFACE#

AsyncCall()#

creates a scheduler daemon task to execute a function asynchronously.

my $Success = $Object->AsyncCall(
    ObjectName               => 'Kernel::System::Ticket',   # optional, if not given the object is used from where
                                                            # this function was called
    FunctionName             => 'MyFunction',               # the name of the function to execute
    FunctionParams           => \%MyParams,                 # a ref with the required parameters for the function
    Attempts                 => 3,                          # optional, default: 1, number of tries to lock the
                                                            #   task by the scheduler
    MaximumParallelInstances => 1,                          # optional, default: 0 (unlimited), number of same
                                                            #   function calls from the same object that can be
                                                            #   executed at the the same time
);

Returns:

$Success = 1;  # of false in case of an error