Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Talk-Point/tp-task-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TP-TaskRunner

Software License Build Status Scrutinizer Code Quality

Task runner framework for Laravel.

Install

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,
]

Usage

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;

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email it@talk-point.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.