Files
awx/awx/main/queue.py
Matthew Jones dcb4959443 Initial qpid development work
* Switch base tower devel image from u14.04 to c7
* Switch container image to build python dependencies into itself
  instead of forcing it to be built on startup
* Upgrade venv pip to 8.1.2
* Neuter queue.py which was heavily tied to redis and was basically
  orphaned code
* Alter local_settings to override default cache settings and use
  memcached
* Alter local settings to refer to qpid instead of redis for celery
  broker
* Purge redis python dependencies and add qpid and memcached
* Update docker-compose to purge redis and add qpid and memcached
2016-08-24 16:23:47 -04:00

38 lines
1.1 KiB
Python

# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import json
from django.conf import settings
__all__ = ['FifoQueue']
# TODO: Figure out wtf to do with this class
class FifoQueue(object):
"""An abstraction class implemented for a simple push/pull queue.
Intended to allow alteration of backend details in a single, consistent
way throughout the Tower application.
"""
def __init__(self, queue_name):
"""Instantiate a queue object, which is able to interact with a
particular queue.
"""
self._queue_name = queue_name
def __len__(self):
"""Return the length of the Redis list."""
#return redis.llen(self._queue_name)
return 0
def push(self, value):
"""Push a value onto the right side of the queue."""
#redis.rpush(self._queue_name, json.dumps(value))
def pop(self):
"""Retrieve a value from the left side of the queue."""
#answer = redis.lpop(self._queue_name)
answer = None
if answer:
return json.loads(answer)