redis-streams-broker
Advanced tools
Comparing version 0.0.11 to 0.0.12
const shortid = require("shortid"); | ||
const Scripto = require("redis-scripto"); | ||
const path = require("path"); | ||
@@ -22,3 +23,3 @@ class StreamChannelBroker { | ||
this._groupPendingSummary = this._destroyingCheckWrapper(this._groupPendingSummary.bind(this), false); | ||
this._scriptManager.loadFromDir('./scripts'); | ||
this._scriptManager.loadFromDir(path.join(__dirname, 'scripts')); | ||
} | ||
@@ -25,0 +26,0 @@ |
{ | ||
"name": "redis-streams-broker", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "This package is a broker to redis stream data type, This package provides guaranteed message delivery feature with acknowledgement.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -81,3 +81,3 @@ # redis-streams-broker | ||
## Current Version: | ||
0.0.10[Beta] | ||
0.0.12[Beta] | ||
@@ -96,5 +96,5 @@ ## License | ||
*redisClient*: Injectable redis client which will be used to send commands to redis server. | ||
`redisClient`: Injectable redis client which will be used to send commands to redis server. | ||
*channelName*: Name of the stream key, if this doesnot exists it will be created on first push or group subscription. | ||
`channelName`: Name of the stream key, if this doesnot exists it will be created on first push or group subscription. | ||
@@ -105,7 +105,7 @@ 2. `publish(payload: any, maximumApproximateMessages?: number, failOnMaxMessageCount:boolean): Promise<string>;` | ||
*payload*: A JS object containing properties which are passed as key values pairs. | ||
`payload`: A JS object containing properties which are passed as key values pairs. | ||
*maximumApproximateMessages*: Appropiate length of the stream it is equal to `~ MAXLENGTH` option in redis. Defaulted to 100. | ||
`maximumApproximateMessages`: Appropiate length of the stream it is equal to `~ MAXLENGTH` option in redis. Defaulted to 100, If negative number is passed then it behaves as non capped stream. | ||
*failOnMaxMessageCount*: if *maximumApproximateMessages* and *failOnMaxMessageCount* is set to true then it will only publish messages untill it reaches the maximum count post that it will start throwing an error, default value is false. | ||
`failOnMaxMessageCount`: if `maximumApproximateMessages` is positive number and `failOnMaxMessageCount` is set to true then it will only publish messages untill it reaches the maximum count post that it will start failling by returning null as message id, default value is false. | ||
@@ -116,5 +116,5 @@ 3. `joinConsumerGroup(groupName: string, readFrom: string): Promise<ConsumerGroup>` | ||
*groupName*: Name of the group to be created ot joined. | ||
`groupName`: Name of the group to be created ot joined. | ||
*readFrom*: Id of the mesage to start reading from. defaulted to `$` to only read new messages recevied on redis, check [redis docs](https://redis.io/commands/xgroup) for more info. | ||
`readFrom`: Id of the mesage to start reading from. defaulted to `$` to only read new messages recevied on redis, check [redis docs](https://redis.io/commands/xgroup) for more info. | ||
@@ -136,13 +136,13 @@ 4. `memoryFootprint(): Promise<number>` | ||
*consumerName*: Name of the consumer who is subscribing via the consumer group object. | ||
`consumerName`: Name of the consumer who is subscribing via the consumer group object. | ||
*handler*: A callback function which will be invoked when new message a.k.a payload(s) arrive. Should be of signature `(payload: Payload[]) => Promise<number>` should be async & return from this function is number of messages to fetch from redis(expected +ve number; -ve or 0 will unsubscribe from the group stopping all further reads from stream,if NAN then defaults to number provided when subscribing), look at `Payload` class below for more details. | ||
`handler`: A callback function which will be invoked when new message a.k.a payload(s) arrive. Should be of signature `(payload: Payload[]) => Promise<number>` should be async & return from this function is number of messages to fetch from redis(expected +ve number; -ve or 0 will unsubscribe from the group stopping all further reads from stream,if NAN then defaults to number provided when subscribing), look at `Payload` class below for more details. | ||
*pollSpan*: Number of millisecond to wait after completion of handler to check for next available message in stream. Defaulted to 1000 milliseconds. | ||
`pollSpan`: Number of millisecond to wait after completion of handler to check for next available message in stream. Defaulted to 1000 milliseconds. | ||
*payloadsToFetch*: Maximum number of messages to fetch in one poll to server this is simillar to `COUNT` command in redis, this is optional and defaulted to 2. | ||
`payloadsToFetch`: Maximum number of messages to fetch in one poll to server this is simillar to `COUNT` command in redis, this is optional and defaulted to 2. | ||
*subscriptionHandle*: Name for subscription handler this is what will be returned from the function, this is defaulted to unique shortid. | ||
`subscriptionHandle`: Name for subscription handler this is what will be returned from the function, this is defaulted to unique shortid. | ||
*readPending*: If set to `true` will read all messages from start of the stream ie: Id = 0 which are in pending list of this consumer and group, once all pending are read it will automatically switch to latest messages from the stream. If set to `false` it will always look for new message from the stream, this is defaulted to `false`. | ||
`readPending`: If set to `true` will read all messages from start of the stream ie: Id = 0 which are in pending list of this consumer and group, once all pending are read it will automatically switch to latest messages from the stream. If set to `false` it will always look for new message from the stream, this is defaulted to `false`. | ||
@@ -153,3 +153,3 @@ 2. `unsubscribe(subscriptionHandle: string): Promise<boolean>` | ||
*subscriptionHandle*: Name of the subscription handle which was returned by subscribe api. | ||
`subscriptionHandle`: Name of the subscription handle which was returned by subscribe api. | ||
@@ -169,3 +169,3 @@ 3. `pendingSummary(): Promise<GroupSummary>` | ||
*deleteMessage*: if set to `true` it will ack & delete the message from the stream if set to `false` will only ack the message defaulted to false. | ||
`deleteMessage`: if set to `true` it will ack & delete the message from the stream if set to `false` will only ack the message defaulted to false. | ||
@@ -172,0 +172,0 @@ |
25386
292