sp-niemand/yii2-jobby

Jobby wrapper for Yii2

dev-master 2015-05-21 13:17 UTC

This package is not auto-updated.

Last update: 2022-06-25 04:18:53 UTC


README

This is a package for Yii2 framework. Store tasks for Jobby in your database (key-value storage, whatever).

Basic usage

Add jobby module to your configuration file:

'modules' => [

    ...

    'jobby' => [
        'class' => '\jobbyDb\JobbyModule',
    ],

    ...

]

Add <projectPath>/yii jobby to your scheduler configuration. For example, cron:

    * * * * * /var/www/project/yii jobby

Now you can use jobby SQL table in MySQL or something similar to configure and schedule tasks.

Advanced usage

It is possible to inject your own model class into the module. Your model must implement \jobbyDb\model\JobbyModelInterface

    'modules' => [

        ...

        'jobby' => [
            'class' => '\jobbyDb\JobbyModule',
            'modelClass' => '\rootNamespace\RedisJobbyModel',
        ],

        ...

    ]