Pending posting to PHP?

I must say that the desire to make some services ex. posting no. Purely for yourself.

How do you make PHP a delayed posting? Here is Crowns, it is called, for example, once per minute. That's how it is called - and so fast.
How to make a posting on schedule, but without the Crown (or with him, but not to produce a cron task for every desired date)? Here in VK the delayed posting. I went in, wrote that it is necessary, choose a date and time. Everything on the specified time something is uploaded.
Maybe it's all in PHP?
July 8th 19 at 11:23
3 answers
July 8th 19 at 11:25
Solution
In php like any other language is possible almost everything. Your task is certainly.
Solved simply enough. You keep a list of what is necessary to post and time of post(in database, in file, does not matter). And the cron once a minute a script is run which checks for tasks. If the time has come, then post and delete the task if no task then just falls asleep again.
Thank you, I had originally planned. Just thought there any extra libraries for this? - Emmet.Stoltenberg commented on July 8th 19 at 11:28
there are libraries. But why for such a simple task to haul even third-party libraries? - Donny71 commented on July 8th 19 at 11:31
: just if the day is planned a large number of calls to the task, I thought that libraries will be a little faster. And can you please name the libraries to be called? - Emmet.Stoltenberg commented on July 8th 19 at 11:34
But if lots of users? Do I need for this task to use beanstalkd, rabbitmq, gearman or something? - winfield.Kassul commented on July 8th 19 at 11:40
July 8th 19 at 11:27
You can't kill PHP script and spin in a loop until the desired time. If it is to answer your question.
If solve your problem, then - cron. Didn't you just read what is CZK, apparently.
Sorry, I added the answer. Originally not formulated. - Emmet.Stoltenberg commented on July 8th 19 at 11:30
July 8th 19 at 11:29
1. Doing an infinite loop in a PHP application and run in daemon mode.
2. Interview task pool and "fall asleep" on time to the next task.
3. Wake up - do.
4. GOTO 2

Find more questions by tags PHP