fastapi-celery icon indicating copy to clipboard operation
fastapi-celery copied to clipboard

Question: high-loaded tasks

Open exactstat opened this issue 1 year ago • 0 comments

I can see that the same file is used on the API side and by the worker - it's the 'worker.py' file. As I understand it, the @celery.task decorator provides the creation of a message in the queue, but the function (task) itself is performed on another service, by the worker, after processing the message with arguments. In my case, the function is extremely resource-consuming (it's a neural network). Can I leave the function on the API side with only arguments (for example, add NotImplementedError to it), and on the worker side I will make its full implementation? To make the question more generalized: can I use only the interface on the API side, and make a full implementation on the worker side?

exactstat avatar Sep 06 '23 12:09 exactstat