2

I have a Gearman Work in php that processes background tasks from client. From time to time I am not able to process that job. I would need a way to delay retry that job after 5 minutes. How can I do that?

What I do now is to do exit(255) but this will retry the job immediately. Also I do not know how can I get the number of failures of that specific job (in the worker).

Questions:

  1. How can I do the above stuff in Gearmand
  2. Is there any other messageing system that is capable of this?
catalinux
  • 1,462
  • 14
  • 26

2 Answers2

2

You can't. At least not using built-in capabilities. This feature is only partly implemented in Gearmand and the PHP module does not expose this functionality. See this discussion on the feature.

People have tried different things, including:

When it comes to tracking failures - again, you can't, AFAIK. See my answer on handling retries in Gearman for a possible solution.

Community
  • 1
  • 1
Aurimas
  • 2,518
  • 18
  • 23
0

Not build in, but you can use a bit of memcached+TTL for that.

Thomas Decaux
  • 21,738
  • 2
  • 113
  • 124