'Pushes the given link to the queue.
Position in the queue is determined by priority.
Equal ranks are sorted FIFO or FILO.
With priority=1.0 and FILO, the link is inserted to the queue.
With priority=0.0 and FIFO, the link is appended to the queue.'

def push(self, link, priority=1.0, sort=FILO):

    if (not isinstance(link, Link)):
        link = Link(url=link)
    dt = time.time()
    dt = (((sort == FIFO) and dt) or (1 / dt))
    bisect.insort(self._queue, ((1 - priority), dt, link))
    self._queued[link.url] = True
