Calling WP Background Processing without AJAX?

Question

I’ve been trying to implement WP background process (https://github.com/deliciousbrains/wp-background-processing), but whenever I try from a method in a class, and calling that method from any sort of WP hook or cron task, the process loops infinitely.

$counter = 0;
do {
 $counter ++;
  self::$process_my_task->push_to_queue( $counter );
} while ( $counter < 10 );

// Start the queue.
self::$process_my_task->save()->dispatch();

I haven’t seen many examples online.

Thanks

0
Best Dev Tutorials 4 months 0 Answers 11 views 0

Leave an answer