A Redis
streamer implementation.
A simple class that issues XADD
commands.
This type defines the item to be streamed.
-
maxlen - defines the
MAXLEN
of the stream - payload - a simple string to string mapping, containing all the data attached to the message to be streamed.
const streamer = new Streamer('redis://127.0.0.1:6379');
(async() {
await streamer.stream({
stream: 'MY_STREAM',
number: 100000,
paylod: {
a: JSON.stringify({
b: 1,
c: 'test',
d: {
e: 'f',
},
}),
g: 'h',
}
});
})();
Dev container is recommended, to run the devel
container:
make build
make install
The workflow runs:
make test
Or separately:
make jest
make syntax