Task runner framework for Laravel.
Via Composer
$ composer require Talk-Point/TPTaskRunner
$ php artisan queue:table
$ php artisan queue:failed-table
$ php artisan migrate --seed
Add to the app/config.php
file in providers
'providers' => [
TPTaskRunner\TaskRunnerServiceProvider::class,
]
To use the tasks polymorph relation extends your model from the TPTaskRunner\Models\TaskRelationBaseModel
model from the Framework.
Than you can get the tasks with the method $model->tasks()->get()
Task:
To create a task, with run()
you start the task.
$model = YouModel::create([]);
$task = \TPTaskRunner\Models\Task::createTask($job_class);
$model->tasks()->save($task);
$task->run();
Task with Data:
To create a task with data.
# Create
$task = \TPTaskRunner\Models\Task::createTaskWithData('Class', ['key' => 'value']);
$task->save();
# In Job Class
$o = $task_load->getJSONData();
$data = $o->key;
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email it@talk-point.de instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.