M
M
max32772019-07-17 10:41:32
Django
max3277, 2019-07-17 10:41:32

Asynchronous POST and GET requests in python?

The task is to make several requests (6-7) to different servers.
Now all requests are executed in turn. Each request takes from 5 to 30 seconds.
Is it possible to do in DJANGO 2.2 so that requests are sent simultaneously (asynchronously), then we get the result and "process" it.
Now I'm using Celery, but I don't understand how to wait for a response from the server.
Or chose the wrong framework for this? Then what frameworks are suitable for asynchronous requests ( not necessarily python)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2019-07-17
@vintello

in short, when setting a task in Celery, each task is assigned a unique identifier and it is returned after the creation of the task,
there are immediately two options:
1. tasks can be combined into a chain and then run the resulting task
2. you can form an array of task identifiers and poll Celery for their status

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question