4

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?

JackWhiteIII
  • 1,388
  • 2
  • 11
  • 25
allevo
  • 844
  • 1
  • 9
  • 20

0 Answers0