downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

mqseries> <GearmanWorker::wait
[edit] Last updated: Fri, 24 Jun 2011

view this page in

GearmanWorker::work

(PECL gearman >= 0.5.0)

GearmanWorker::workانتظار و انجام کارها

Description

public bool GearmanWorker::work ( void )

انتظار برای تقسیم کارها و فراخوانی تابع بازگشتی مناسب. ایجاد E_WARNING به همراه آخرین خطای Gearman اگر کد بازگشتی یکی ازGEARMAN_SUCCESS، GEARMAN_IO_WAIT، یا GEARMAN_WORK_FAIL نباشد.

Parameters

This function has no parameters.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 مثال GearmanWorker::work()

<?php

# create the worker
$worker = new GearmanWorker(); 

# add the default job server (localhost)
$worker->addServer(); 

# add the reverse function
$worker->addFunction("reverse""my_reverse_function"); 

# start te worker listening for job submissions
while ($worker->work()); 
 
function 
my_reverse_function($job

  return 
strrev($job->workload()); 
}

?>

See Also



add a note add a note User Contributed Notes GearmanWorker::work - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites