Tracking Worker based on the workload Parameter

47 views
Skip to first unread message

Reda Yamani

unread,
Feb 16, 2018, 4:25:50 PM2/16/18
to Gearman
Hello all,

I am new to Gearman and I am using it in an email setting. We are sending email campaigns using Gearman. So we create a campaigns (divided in batches sent every x minutes) and we assign those campaigns to worker that dispatches the batches to the SMTP server. So 1 campaign to 1 Worker... When debugging (In the case of multiple of multiple campaigns so multiple workers) I cant figure out which worker is handling which campaign ID.
I hope this was clear.... Thanks in advance
Red

Алексей Пастухов

unread,
Feb 20, 2018, 10:28:01 AM2/20/18
to Gearman
gearmand dispatches a job to the next free worker. If a client dispatches a task to gearmand, it get's a handle in return. The same handle is a part of the job message a worker gets from gearmand. So you could identify by the handle which worker takes over which job.

Reda Yamani

unread,
Feb 20, 2018, 2:42:23 PM2/20/18
to Gearman
Thanks you so much for your answer... now another follow up question... Would it get me also the status or a workload if is waiting in a queue (because all available workers are engaged)
Thanks in advance ( we are using php )

Алексей Пастухов

unread,
Feb 21, 2018, 8:42:21 AM2/21/18
to Gearman
On Tuesday, 20 February 2018 20:42:23 UTC+1, Reda Yamani wrote:
Thanks you so much for your answer... now another follow up question... Would it get me also the status or a workload if is waiting in a queue (because all available workers are engaged)

I'm not sure to understand you correctly. If your client sends SUBMIT_*_BG to gearman, gearmand returns immediately a handle. Otherwise gearmand will waiting for work result and at the end of it returns you a handle.
GET_STATUS request could be used to fetch information about of work progress. But it'll valuable only if you worker sends WORK_STATUS to gearmand.
Reply all
Reply to author
Forward
0 new messages