Status return from Async

8 views
Skip to first unread message

Đoàn Cao Nghĩa

unread,
Nov 16, 2009, 4:49:21 AM11/16/09
to gearman
Hi,

I have problem wit gearman,

I have do job with doBackground

$job_handle = $client->doBackground("some_func",'my string');

and I have a handle of this job, another process, i want to check
status of job with :


$status = $client->jobStatus($saved_job_handle);

but when job complete, this return array (false,false,0,0);

can i get more status or result of this job ?

Thanks for help.
Nghia

Eric Day

unread,
Nov 16, 2009, 3:32:05 PM11/16/09
to gea...@googlegroups.com
Hi!

On Mon, Nov 16, 2009 at 01:49:21AM -0800, Đoàn Cao Nghĩa wrote:
> I have do job with doBackground
>
> $job_handle = $client->doBackground("some_func",'my string');
>
> and I have a handle of this job, another process, i want to check
> status of job with :
>
> $status = $client->jobStatus($saved_job_handle);
>
> but when job complete, this return array (false,false,0,0);

This is normal. When the job is done, the job server drops all
knowledge of the job. If you want the result of the background job,
you will want to store that somewhere with a unique key to find
it again. For example, you could use memcached, MySQL, a shared
filesystem, or some other data store appropriate for your application.

Some things on the roadmap for Gearman is a temporary result cache
in the job server, and probably put a TTL on each job result (you
don't want it to grow unbound for obvious reasons).

-Eric

Đoàn Cao Nghĩa

unread,
Nov 17, 2009, 1:15:45 AM11/17/09
to gearman
Hi Eric ,
At the moment, I trying store it to memcached.
Thanks for response this.

Nghia
Reply all
Reply to author
Forward
0 new messages