I
I
Igor Tkachenko2015-01-26 00:27:32
PHP
Igor Tkachenko, 2015-01-26 00:27:32

How to build task logic in gearman php?

There is an application that always needs to check the task and its time from the database, and if this time is < time (), then perform the action, there are many such tasks, I tried the supervisor in conjunction with gearman, but it turns out that if the time has not yet come, gearman executes the task, and reads it completed, and when the time comes, the task is not executed accordingly.
How to be? How are these issues resolved in large projects?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Push Pull, 2015-01-26
@deadbyelpy

is it possible to make it simpler and give up time in favor of the "done" flag or not?

N
NosFire, 2015-01-26
@NosFire

As an option, use a client that runs every minute by cron, and not a worker. And as soon as the time has come to send the task to the worker.
If you need delayed tasks, then it's probably better to look towards beanstalkd, in it you can set the time before the task is completed.

V
Vlad, 2015-01-26
@DaFive

We do it through cron. The script is called, checks are made, the task is queued and executed. It also depends on time accuracy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question