Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redis-streams-broker

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-streams-broker - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

0

asyncProcessor.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc