Background task

I want to add a long running background task to my sanic service. I know two ways to do it (celery/app.add_task)。since my service needs to support very high concurrent access, I’m wondering how can I do the background task that can have minimal impact on my sanic service performance?

I would say use a pub-sub model and a message broker. This is pretty common for handling external tasks or long running tasks that don’t really need to be run by Sanic.

Celery with a separated worker will not have much impact, but app.add_task will.