-
Notifications
You must be signed in to change notification settings - Fork 2
Description
We can have long-running queries that currently block a user from doing anything else. For example, searches on SDSS programs, without any other constraints can result in up to ~15 minutes queries. We should explore implementing a task-manager, e.g. https://taskiq-python.github.io/ as a way to offload long-running jobs.
I think we'd want something that manages the background task or query, and does not block Valis or Zora. Ideally we'd have a way to track the status of the job: e.g. running, completed, error, and potentially have a dashboard of jobs. Another consideration is anonymous versus user tasks and if we need one or the other or both.
FastAPI has some support for Background Tasks . I'm not sure if this is enough for our purposes. Other related packages:
- Celery - https://docs.celeryq.dev/en/stable/index.html
- Dramatiq - https://dramatiq.io/
- Huey - https://huey.readthedocs.io/en/latest/
I do like Taskiq as a simpler, more modern approach, but we may want to consider alternatives.