A
A
Andrey Volo2016-12-22 10:08:06
Django
Andrey Volo, 2016-12-22 10:08:06

How to implement 3 parallel tasks in Django?

There is a django application that performs 3 internal tasks:
1) At the request of the user, collect data from the user in a sequential queue, which will later be used for parsing
2) Sequentially process the queue (receive data from the social network)
3) Regularly, every 60 minutes, perform additional parsing (I thought this task should also be included in the queue from the first paragraph)
Having studied similar questions on the forum, I decided to use cron, but I can’t understand how it works, tell me:
1) Is Cron generally the right choice for such a task?
2) How is cron different from crontab? Are these 2 parts of the same or different things?
3) How to start the process of regular execution of tasks (in cron or crontab)?
I created test tasks, with the help of runcron or crontab run they are test processed, but I don’t understand how to start a regular process (for example, every hour or as soon as new data appears in the database, the system works)
4) How to make 3 parallel processes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2016-12-22
@OnYourLips

1) Yes
2,3) This is a program and a task file for it.
4) Run 3 workers.
And this will be much more difficult for you - you need to use queues.

M
Mykola, 2016-12-22
@IKMOL

You need Celery . Direct link to the doc. Write tasks in Django, launch a daemon to execute them. How to do it for Django

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question