For example, I have a single worker that listens for functions a() and b():
$worker = new GermanWorker();
$worker->addServer();
$worker->addFunction('a', 'a');
$worker->addFunction('b', 'b');
while ($worker->work());
I stop the worker, and I then run a client that does the following:
$client = new GearmanClient();
$client->addServer();
$client->doHighBackground('b', 'whatever');
$client->doLowBackground('a', 'whatever');
If I then start the worker, it will run the low priority task before the high priority task, due to the order in which the functions were added to the worker.
For example, I have a single worker that listens for functions a() and b():
$worker = new GermanWorker(); >addServer( ); >addFunction( 'a', 'a'); >addFunction( 'b', 'b');
$worker-
$worker-
$worker-
while ($worker->work());
I stop the worker, and I then run a client that does the following:
$client = new GearmanClient(); >addServer( ); >doHighBackgrou nd('b', 'whatever'); >doLowBackgroun d('a', 'whatever');
$client-
$client-
$client-
If I then start the worker, it will run the low priority task before the high priority task, due to the order in which the functions were added to the worker.