def pipeline_publish_message(
        self, message, expire=None, transaction=True
    ):
        """
        Like publish_message, but pipelines all publish and setex
        Redis commands to save round trips to the Redis datastore.
        """
        if expire is None:
            expire = self._expire
        if not isinstance(message, RedisMessage):
            raise ValueError('message object is not of type RedisMessage')

        pipeline = self._connection.pipeline(transaction=transaction)

        for channel in self._publishers:
            pipeline.publish(channel, message)
            if expire > 0:
                pipeline.setex(channel, expire, message)

        pipeline.execute()

        Like publish_message, but pipelines all publish and setex
        Redis commands to save round trips to the Redis datastore.
        
ws4redis/redis_store.py