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}
def create(self, request): queue = server_queue(request.server) try: queue.delete(int(request.POST['job'])) except Exception, e: pass