Gearman client NON_BLOCKING mode vs doBackground

519 views Asked by At

I'm looking for what the options GEARMAN_CLIENT_NON_BLOCKING does. Using this example:

<?php

$client = new GearmanClient();
$client->setOptions(GEARMAN_CLIENT_NON_BLOCKING);
$client->addServer('127.0.0.1', 4730);
var_dump("before");
$client->doNormal('queue', 'data');
var_dump("after");

The script never prints "after" if no worker listens on "queue" function. Reading the documentation (http://gearman.info/libgearman/gearman_client_options.html), this options should permit to perform the request in "non-blocking" mode. I known if I want to send a job without waiting the response from the worker, I should use "doBackground" method.

So, which means "non-blocking" mode at the client side?

0

There are 0 answers