abhishek-ram/django-pyas2

Async MDN - use of a queue instead of a schedules job?

Opened this issue · 6 comments

Am wondering about the way currently ASYNC MDN's are sent. Currently I do have the MDN sending job run every 10 minutes to clean up, which works fine. But is this the way we should be doing this, or would it not make more sense to queue a task on request for async MDN which would be handled by workers to that job?

Was thinking of looking into django-q for this for the reason of Django ORM being the broker, so that no additional broker is initially needed.

Any thoughts ?

Hmm, yeah it makes sense.

Thinking of implementing this with async view as believe separate worker and brokers might be too complex for many deployments. Unfortunately django/django#13483 has not made it into django 3.2 yet. Believe this would be the cleanest way.

I am not sure how an async view would help here, we would still need a way to schedule the job and how would it even work when there are multiple thread/workers of the web app. The scalable way is to use a queue and broker.

If u mean by using django q then its good the other way is just unreliable

Actually I was thinking of the other way, but am of course ok with django-q as initially intended.