S
S
Sergey Bard2018-06-26 10:31:34
Yii
Sergey Bard, 2018-06-26 10:31:34

What is the best way to do it through queue or cron?

Hello everyone, tell me how best to do it, I'm making a system for tracking projects, various analytics, etc., when a user comes in and wants to get data from any service right now (update), then I throw his request into the queue ? and I execute it there, but I also need to update the data for all services every morning, I think to do this...
I run cron in which I determine for which project what needs to be done, i.e. if for a service you need to go to several services, then I create several tasks in the crown and throw them into the queue as well, but is this correct ?, maybe it would be better to run child crowns in the parent crown instead of queue ? doubts with the queue due to the fact that a user will log into the system and add a new queue, then he will wait until all the previous ones have worked, so I think it is necessary to separate the queues for users, so to speak, and everything else under the crowns?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GTRxShock, 2018-06-26
@GTRxShock

background execution - queue (if several services react to an event, look at the exchange type topic)
scheduled execution - cron
execution through the console - cli command (needed for cron) and what it will do is your decision, or add a task to the queue ( to perform in the background), or immediately do what you need (depending on the task, respectively)
decompose your tasks, until you clearly understand what exactly you want to do and the situation should become clear, I
advise you to use paper and a pen)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question