wp-background-processing-example
wp-background-processing-example copied to clipboard
Dispatch seems to have no effect.
Hi, Thank you for the efforts. I am sure it is not working because I am not using it correctly. I am hoping you can help me with that :)
Here is what I am doing:
class WP_Example_Request extends WP_Async_Request {
/**
* @var string
*/
protected $action = 'create_send_pdf';
/**
* Handle
*
* Override this method to perform any actions required
* during the async request.
*/
protected function handle() {
file_put_contents("logs.txt", "writing file" );
}
and in my code:
echo ("callign backgroudnd thread <br />");
$example_request = new WP_Example_Request();
$example_request->data( array( 'orderID' => $_GET["orderID"] ) )->dispatch();
echo (" backgroudnd thread called");
It seems like the file is not being written any where. I am trying to find a way to log what I am doing, to be able debug later.
Anything I am doing wrong?
@mhdtahawi I have the same issue, did you figure this out?
It's my first time looking at this library and I am having the same issue.
I am using background processing and I am seeing the wp_{action}
added to the wp_options
table but I am not seeing any new WP Cron events added to the queue.
Did anyone ever get a fix for this? My dispatch is not adding new cron jobs either.
same issue
Looks like it's borked. I'm going to go with Delicious Brains background processor - looks like it's written by the same guy but hopefully it works https://github.com/deliciousbrains/wp-background-processing