redis-streams-broker
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -0,0 +0,0 @@ module.exports = class AsyncProcessor { |
@@ -0,0 +0,0 @@ |
17
index.js
@@ -1,3 +0,3 @@ | ||
const shortid = require("shortid"); | ||
const Scripto = require("redis-scripto"); | ||
const _nonSecureId = require("nanoid/non-secure").nanoid; | ||
const Scripto = require("redis-scripto2"); | ||
const path = require("path"); | ||
@@ -46,3 +46,3 @@ | ||
async _subscribe(groupName, consumerName, handler, pollSpan = 1000, payloadsToFetch = 2, subscriptionHandle = shortid.generate(), readPending = false) { | ||
async _subscribe(groupName, consumerName, handler, pollSpan = 1000, payloadsToFetch = 2, subscriptionHandle = _nonSecureId(), readPending = false) { | ||
const intervalHandle = setTimeout(async () => { | ||
@@ -108,7 +108,8 @@ try { | ||
for (let messageIdIdx = 0; messageIdIdx < responses[responseIdx][1].length; messageIdIdx++) { | ||
let messageId = responses[responseIdx][1][messageIdIdx][0]; | ||
let payload = { "channel": streamName, "id": messageId, payload: {} }; | ||
let raw = responses[responseIdx][1][messageIdIdx]; | ||
let messageId = raw[0]; | ||
let payload = { "channel": streamName, "id": messageId, "payload": {}, "raw": raw }; | ||
payload["markAsRead"] = async (dropMessage) => await this._acknowledgeMessage(groupName, messageId, dropMessage); | ||
payload["markAsRead"] = async (dropMessage) => await this._acknowledgeMessage(groupName, messageId, dropMessage); | ||
if (responses[responseIdx][1][messageIdIdx][1] == null) { | ||
if (raw[1] == null) { | ||
//This happens when actual message is rolled over but its still in pending list of the consumer. | ||
@@ -119,4 +120,4 @@ //Or someone deleted the message from Redis while it was still pending. | ||
else { | ||
for (let propertyIdx = 0; propertyIdx < responses[responseIdx][1][messageIdIdx][1].length;) { | ||
payload.payload[responses[responseIdx][1][messageIdIdx][1][propertyIdx]] = responses[responseIdx][1][messageIdIdx][1][propertyIdx + 1]; | ||
for (let propertyIdx = 0; propertyIdx < raw[1].length;) { | ||
payload.payload[raw[1][propertyIdx]] = raw[1][propertyIdx + 1]; | ||
propertyIdx += 2; | ||
@@ -123,0 +124,0 @@ } |
@@ -0,0 +0,0 @@ This is free and unencumbered software released into the public domain. |
{ | ||
"name": "redis-streams-broker", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "This package is a broker to redis stream data type, This package provides guaranteed message delivery feature with acknowledgement.", | ||
@@ -34,4 +34,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"redis-scripto": "^0.1.3", | ||
"shortid": "^2.2.15" | ||
"nanoid": "^3.1.25", | ||
"redis-scripto2": "^0.2.2" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
@@ -72,4 +72,4 @@ # redis-streams-broker | ||
1. Authors :heart for Open Source. | ||
2. [shortid](https://www.npmjs.com/package/shortid) for auto generating subscribtion handles. | ||
3. [redis-scripto](https://www.npmjs.com/package/redis-scripto) for handling lua scripts. | ||
2. [nanoid](https://www.npmjs.com/package/nanoid#js) for auto generating subscribtion handles. | ||
3. [redis-scripto2](https://www.npmjs.com/package/redis-scripto2) for handling lua scripts. | ||
@@ -82,3 +82,3 @@ ## Contributions | ||
## Current Version: | ||
0.0.12[Beta] | ||
0.0.13[Beta] | ||
@@ -174,2 +174,1 @@ ## License | ||
4. `consumerStats: any`: Extra information provided by `XPENDING` command. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25885
293
172
+ Addednanoid@^3.1.25
+ Addedredis-scripto2@^0.2.2
+ Addeddebug@4.3.7(transitive)
+ Addeddenque@1.5.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedredis@3.1.2(transitive)
+ Addedredis-commands@1.7.0(transitive)
+ Addedredis-errors@1.2.0(transitive)
+ Addedredis-parser@3.0.0(transitive)
+ Addedredis-scripto2@0.2.2(transitive)
- Removedredis-scripto@^0.1.3
- Removedshortid@^2.2.15
- Removeddebug@0.7.4(transitive)
- Removednanoid@2.1.11(transitive)
- Removedredis@0.8.6(transitive)
- Removedredis-scripto@0.1.3(transitive)
- Removedshortid@2.2.16(transitive)