E
E
Evstegney Chachlyk2019-06-02 20:03:11
Python
Evstegney Chachlyk, 2019-06-02 20:03:11

How to run tasks asynchronously as they arrive?

Tasks arrive at an indefinite interval,
there are functions to solve them,
they all need to run asynchronously and do not interfere with the main loop

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Kuts, 2019-06-02
@fox_12

Celery

I
Ivan Yakushenko, 2019-06-02
@kshnkvn

It seems to me that multithreading will suit you more.
Just run the desired function like this:

from threading import Thread

Thread(target=ваша_функция, args=аргументы_если_они_есть).start()

As a result, your function works independently of the others and you can run as many threads as you need.

N
Nikolay Kiselev, 2019-06-02
@oceean

asyncio. It is very simple, unlike trading and similar ones, and it will do everything on its own, unlike celery. In order to understand it in 10 minutes, I advise you to create an aiohttp server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question