Latest

Tuesday, July 11, 2017

Laravel . Cron vs Queue

Asked by: Zara Danielyan


Hello fellow programmers. I google it before posting! Still confused about . So here is the idea. Users are planning post to be posted on their social media (concrete time ). They can change post time even 2 minutes before . Cron would work as expected if it run every minute ,but it seems old solution. On the other hand queue works different (as far as I get) , trying to make better performance which means if there are high number of requests it will not post !! Is there anything I am missing??? Thanks in advance


Answers

Answered by: gilhad at 2017-07-11 09:16PM



I personally prefere old and reliable concepts over new and unreliable one.

About cron - I did set it to run regularry user script (under the user account) and then user can modify that script how often he wants and cron runs it regularry without need for reloading configuration. And the user script can do anything user can - so it can check if time is larger than some value and some unsent messages are pending and eventually send everything needed. So even if it fails send on scheduled time (maybe server down or anything else), it would be send next time the cron hits (maybe every minute)




Source

No comments:

Post a Comment

Adbox