tdmangukiya / django-queue-service

Automatically exported from code.google.com/p/django-queue-service
0 stars 0 forks source link

python api for accessing queues #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
HTTP api is good and all, but it would be handy if there was some public
python APIs around qa.queue.models.Queue etc to create/manage
queue/messages. I do not like the idea of doing http request from within
another http request, if not for any other reason but to make sure
runserver does not choke on it, as its single threaded. 

It can also become part of django's transaction management if used as part
of django views. 

Original issue reported on code.google.com by upadh...@gmail.com on 6 Aug 2008 at 9:23

GoogleCodeExporter commented 8 years ago
I just slapped DQS into my project's INSTALLED_APPLICATIONS,
so I haven't started working on a message consumer of any
sort yet. Later I will try the HTTP with Curl.

But this issue caught my eye...

Am I missing something:

from qs.queue import models as queue_models

content = 'DQS has too many open issues'

foo_queue = queue_models.Queue.objects.get(name= 'foo')
message = queue_models.Message.objects.create(message=content, queue=foo_queue)

Because that works just fine; what other kind of API should there be?

Of course if Django supported multiple databases, one could run a dedicated
db/web of DQS and have only queue_models' contents go there, but even
that would be through the same Django API..?

Thanks!

-- 
mjt

Original comment by markus.t...@gmail.com on 26 May 2009 at 1:50