django-pyas2 icon indicating copy to clipboard operation
django-pyas2 copied to clipboard

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

Open chadgates opened this issue 5 years ago • 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 ?

chadgates avatar May 28 '20 09:05 chadgates

Hmm, yeah it makes sense.

abhishek-ram avatar May 28 '20 14:05 abhishek-ram

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

chadgates avatar Apr 14 '21 20:04 chadgates

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.

abhishek-ram avatar Apr 15 '21 02:04 abhishek-ram

Was thinking of this approach: https://www.valentinog.com/blog/django-q/#how-about-asynchronous-django .

chadgates avatar Apr 15 '21 05:04 chadgates

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

abhishek-ram avatar Apr 15 '21 15:04 abhishek-ram

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

chadgates avatar Apr 15 '21 17:04 chadgates