L
L
LakeForest2022-04-05 20:01:32
Python
LakeForest, 2022-04-05 20:01:32

Does celery make sense if you want to get the result of a method?

There is a REST method on fastapi:
generate audio, save audio, return audio. Each request is logged.
If the audio exists, then returns the existing one.

What I want to do:
1. Check if audio exists: return if yes.
2. Else generate audio.
3. Return.
4. In BackgroundTasks save audio recording and log.

Do I understand correctly that in terms of response speed, I will get a profit due to the fact that I will not wait for the log to be written and the record to be saved?

I noticed that earlier colleagues used celery: task = celery.task(); task.get(). But I can't figure out if it's worth it?
What is the point of using celery if you need to wait for the result?
Which is better: celery or a separate service for logging with rabbitmq?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question