Open jgillick opened 1 month ago
If a large number of publish calls need to be made, they call all be batched into a single HTTP request to redis with a pipeline.
This PR attempts to keep to keep the familiar redis pipelining API while supporting the PubSub config and serializer.
If you have a list to publish:
const pubSub = new RedisPubSub({ ... }); // Create pipeline const pipeline = pubSub.pipeline(); [1,2,3,4,5,6].forEach((id) => pipeline.publish('Test', {id})) // Execute the pipeline to redis await pipeline.exec();
If you have a specific number of publish calls to make at the same time:
const pubSub = new RedisPubSub({ ... }); await pubSub .pipeline() .publish('Test1', {}) .publish('Test2', {}) .publish('Test3', {}) .exec();
If a large number of publish calls need to be made, they call all be batched into a single HTTP request to redis with a pipeline.
This PR attempts to keep to keep the familiar redis pipelining API while supporting the PubSub config and serializer.
Basic Example
If you have a list to publish:
Chainable calls
If you have a specific number of publish calls to make at the same time: