Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Task | Run() | MultiTasking
  • Hi everyone,
    I have multiple task defined on fuel/app/task.
    I wish run all this task at one time, into run() function or same function.

    How can i do it that?

    Anyone can help me?
  • HarroHarro
    Accepted Answer
    Multitasking can only be done with a background queue processor, either with mutiple queue workers, or with a queue worker processing spawned tasks asynchronously. Any other solution will only run them sequentially.

    If that is sufficient, tasks are just classes, so you can create a superclass:

    namespace Fuel\Tasks;
    class Alltasks
    {
        public static function run($params)
        {
            \Fuel\Tasks\TaskA::run();
            \Fuel\Tasks\TaskB::run();
            \Fuel\Tasks\TaskC::run();
        }
    }

    and call it with 

    oil refine Alltasks

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion