A replacement to the default redis pipeline method which manage saving
        and restoring of the connection.
        ALL calls to redis for the current database will pass via the pipeline.
        So if you don't use watches, all getters will not return any value, but
        results will be available via the pipe.execute() call.
        Please refer to the redis-py documentation.
        To use with "with":
        ###
        # Simple multi/exec
        with database.pipeline() as pipe:
            # do some stuff...
            result = pipe.execute()
        ###
        # Simple pipeline (no transaction, no atomicity)
        with database.pipeline(transaction=False) as pipe:
            # do some stuff...
            result = pipe.execute()
        ###
        # Advanced use with watch
        with database.pipeline() as pipe:
            while 1:
                try:
                    if watches:
                        pipe.watch(watches)
                    # get watched stuff
                    pipe.multi()
                    # do some stuff...
                    return pipe.execute()
                except WatchError:
                    continue

def pipeline(self, transaction=True, share_in_threads=False):
        """
        A replacement to the default redis pipeline method which manage saving
        and restoring of the connection.
        ALL calls to redis for the current database will pass via the pipeline.
        So if you don't use watches, all getters will not return any value, but
        results will be available via the pipe.execute() call.
        Please refer to the redis-py documentation.
        To use with "with":
        ###
        # Simple multi/exec
        with database.pipeline() as pipe:
            # do some stuff...
            result = pipe.execute()
        ###
        # Simple pipeline (no transaction, no atomicity)
        with database.pipeline(transaction=False) as pipe:
            # do some stuff...
            result = pipe.execute()
        ###
        # Advanced use with watch
        with database.pipeline() as pipe:
            while 1:
                try:
                    if watches:
                        pipe.watch(watches)
                    # get watched stuff
                    pipe.multi()
                    # do some stuff...
                    return pipe.execute()
                except WatchError:
                    continue
        """
        return _Pipeline(self, transaction=transaction, share_in_threads=share_in_threads)