question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`messageBuffer` support

See original GitHub issue

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch graphql-redis-subscriptions@2.3.1 for the project I’m working on.

Here is the diff that solved my problem:

diff --git a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts
index bad3e89..d5a916c 100644
--- a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts
+++ b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.d.ts
@@ -37,5 +37,5 @@ export declare type Trigger = string | Path;
 export declare type TriggerTransform = (trigger: Trigger, channelOptions?: unknown) => string;
 export declare type Reviver = (key: any, value: any) => any;
 export declare type Serializer = (source: any) => string;
-export declare type Deserializer = (source: string) => any;
+export declare type Deserializer = (source: any) => any;
 export {};
diff --git a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.js b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.js
index 443893a..6ea54fa 100644
--- a/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.js
+++ b/node_modules/graphql-redis-subscriptions/dist/redis-pubsub.js
@@ -82,8 +82,8 @@ var RedisPubSub = (function () {
                 console.error("No publisher or subscriber instances were provided and the package 'ioredis' wasn't found. Couldn't create Redis clients.");
             }
         }
-        this.redisSubscriber.on('pmessage', this.onMessage.bind(this));
-        this.redisSubscriber.on('message', this.onMessage.bind(this, undefined));
+        this.redisSubscriber.on('pmessageBuffer', this.onMessage.bind(this));
+        this.redisSubscriber.on('messageBuffer', this.onMessage.bind(this, undefined));
         this.subscriptionMap = {};
         this.subsRefsMap = {};
         this.currentSubscriptionId = 0;

This issue body was partially generated by patch-package.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skabbescommented, May 10, 2021

I’m not a maintainer, but I gave it a shot here: https://github.com/davidyaha/graphql-redis-subscriptions/pull/360

Selfishly just trying to breath a little life back into this project, so I can get some feedback on my issue too. https://github.com/davidyaha/graphql-redis-subscriptions/issues/359

Cheers, @AlaaZorkane hope this can get accepted.

1reaction
skabbescommented, May 10, 2021

This definitely works, but I think it breaks backwards compatibility. Maybe an option(s) in the constructor to select “buffer mode” or not.

new RedisPubSub({
  ...
  messageEventName: 'messageBuffer',
  pmessageEventName: 'pmessageBuffer',
})

But that’s a little verbose, maybe:

new RedisPubSub({
  ...
  useBufferMessages: true,
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

FreeRTOS message buffers - circular buffers
Message buffers allow variable length discrete messages to be passed from an interrupt service routine to a task, or from one task to...
Read more >
MessageBuffer Class (System.ServiceModel.Channels)
Implements methods that can be used to extend run-time behavior for an endpoint in either a service or client application. Message.CreateMessage Method (System....
Read more >
log4cxx::helpers::MessageBuffer Class Reference
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the message parameter. More... #include <messagebuffer.h>. Public ...
Read more >
Tuning the maximum message buffer space - IBM
XCF acquires message buffers on an as needed basis, that is, XCF acquires only those buffers needed to support the current message traffic...
Read more >
OracleAS Adapter for Tuxedo Message Buffer Support
OracleAS Adapter for Tuxedo Message Buffer Support · STRING : A null terminated character array. · CARRAY : An array of un-interpreted arbitrary...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found