Inserts a Task into the queue

        :param task: :class:`~redisqueue.AbstractTask` instance
        :return: Boolean insert success state
        :exception: ConnectionError if queue is not connected

def put(self, task):
        """
        Inserts a Task into the queue

        :param task: :class:`~redisqueue.AbstractTask` instance
        :return: Boolean insert success state
        :exception: ConnectionError if queue is not connected
        """

        if not self.connected:
            raise QueueNotConnectedError("Queue is not Connected")

        if task.unique:
            # first lets check if we have this hash already in our queue
            if not self.__db.sismember(self._lock_key, task.unique_hash()):
                self.__db.sadd(self._lock_key, task.unique_hash())
            else:
                raise TaskAlreadyInQueueException(
                    'Task already in Queue [{hash}]'.format(
                        hash=task.unique_hash()))

        self.__db.lpush(self._key, task.to_json())

        return True