Bundle to write efficient and threadable cronjobs.

Installs: 369

Dependents: 0

Stars: 3

Watchers: 13

Type: bundle

2.4.0 2014-01-03 09:22 UTC


License informations: LGPL

This bundle was made, to create powerfull and efficient cronjobs wich also can use multithreading (requires the php PCNTL-module).



namespace basecom\ExampleBundle\Command;

use basecom\CronjobBundle\Command\CronjobCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ExampleCommand extends CronjobCommand
    protected function configure()
             ->setDescription('Shows the easy usage of this nice CronjobBundle');

    protected function executeCronjob(InputInterface $input, OutputInterface $output, $loopcount, $preloopResult = null)
        $output->writeln("Hello World!");

In this basic configuration, the cronjob will run about 50 seconds and between each executeCronjob()-call will be a pause of one second.

If you trigger this command, you will see the "Hello World!"-output about 50 times.