v1.1.0
Added init tasks
You can now define tasks that are executed on every worker instance before the first task is executed.
This is helpful to run some initial setup or (in case of the ForkWorker)
to clear some variables that are inherited from the parent process, e.g. database connections.
// init tasks are always provided by a task factory
$taskmaster->setDefaultInitTaskFactory(new InitTaskFactory());
// but taskmaster can create task factories automatically by cloning or instancing a task
$taskmaster->setDefaultInitTask(new InitTask());
$taskmaster->setDefaultInitTask(InitTask::class);
// you can also define a task factory for a specific worker
$worker->setInitTaskFactory(new InitTaskFactory());