'Constructor for a PikaQueue.
Not works with python 3. Default for python 2.
amqp_url:   https://www.rabbitmq.com/uri-spec.html
maxsize:    an integer that sets the upperbound limit on the number of
items that can be placed in the queue.
lazy_limit: as rabbitmq is shared between multipul instance, for a strict
limit on the number of items in the queue. PikaQueue have to
update current queue size before every put operation. When
`lazy_limit` is enabled, PikaQueue will check queue size every
max_size / 10 put operation for better performace.'

def __init__(self, name, amqp_url='amqp://guest:guest@localhost:5672/%2F', maxsize=0, lazy_limit=True):

    self.name = name
    self.amqp_url = amqp_url
    self.maxsize = maxsize
    self.lock = threading.RLock()
    self.lazy_limit = lazy_limit
    if (self.lazy_limit and self.maxsize):
        self.qsize_diff_limit = int((self.maxsize * 0.1))
    else:
        self.qsize_diff_limit = 0
    self.qsize_diff = 0
    self.reconnect()
