Пример #1
0
 def read(self, request):
     queue = server_queue(request.server)
     queue.watch('caminus-broadcast-%s'%request.server.id)
     events = []
     job = queue.reserve(timeout=30)
     while job:
       job.bury()
       events.append({'id': job.jid, 'event': json.loads(job.body)})
       job = queue.reserve(timeout=0)
     return {'events': events}
Пример #2
0
 def create(self, request):
     queue = server_queue(request.server)
     try:
         queue.delete(int(request.POST['job']))
     except Exception, e:
         pass