How to control the ttr in a job worker?

72 views
Skip to first unread message

TofuLay

unread,
Oct 17, 2016, 7:37:57 PM10/17/16
to beanstalk-talk
How to control the ttr in a job worker?

TofuLay

unread,
Oct 17, 2016, 7:37:57 PM10/17/16
to beanstalk-talk
How to control the ttr when a job need more seconds second in a client worker

Scott Wiersdorf

unread,
Oct 17, 2016, 9:34:48 PM10/17/16
to beanstalk-talk
If I understand your question correctly, a client can "touch" a job, which will reset the TTR on the job.


Scott

TofuLay

unread,
Oct 19, 2016, 5:01:22 AM10/19/16
to beanstalk-talk
My english is poor!
So sorry!
My problem is : how to know the job will time out and when is the right time to send "touch"?
Thank you very much!!!

在 2016年10月18日星期二 UTC+8上午9:34:48,Scott Wiersdorf写道:

Scott Wiersdorf

unread,
Oct 19, 2016, 12:09:16 PM10/19/16
to beanstalk-talk
You can use the stats-job(id) command from the client. The server will return the id again, the tube it came from, its state, priority, age, ttr, and other information also described in the protocol document I linked earlier. If your client is non-blocking (and handling multiple jobs), you may also receive a "DEADLINE_SOON" from the server which indicates the job is within 1 second of its TTR (which would also indicate you need to touch the job).

In practice, you may find it easier not to ask about the TTR and instead just send a "touch" command every time your worker has the opportunity to do so *and* if the job is making progress.

Scott

TofuLay

unread,
Oct 24, 2016, 2:29:57 AM10/24/16
to beanstalk-talk
Thank you very much

在 2016年10月20日星期四 UTC+8上午12:09:16,Scott Wiersdorf写道:
Reply all
Reply to author
Forward
0 new messages