GithubHelp home page GithubHelp logo

Comments (6)

d-exclaimation avatar d-exclaimation commented on July 17, 2024

Pioneer only opens 1 WebSocket connection for each client and uses either graphql-ws or subscriptions-transport-ws protocol to handle multiple subscription operations within that 1 connection.

If you notice that this isn't the case, let me know and I'll try to get it fixed

from pioneer.

cshadek avatar cshadek commented on July 17, 2024

Got it. I assumed as much but I wasn't sure.

Do you know if there is any downside to having many subscriptions open at the same time from a client?

I am using Redis PubSub.

from pioneer.

d-exclaimation avatar d-exclaimation commented on July 17, 2024

Not quite sure if there would be obvious problems having many subscriptions open. I haven't done many tests with a significantly large number of subscription operations active

from pioneer.

cshadek avatar cshadek commented on July 17, 2024

So, if I understand correctly the protocol handles multiplexing from the client and Pioneer Redis PubSub's Broadcast makes sure there is only one Redis connection per topic?

from pioneer.

cshadek avatar cshadek commented on July 17, 2024

And if that's the case, in d-exclaimation/pioneer-redis-pubsub#8,

Maybe the answer is that in:


let redisConfig = try RedisConfiguration(
            url: redisUrl,
            tlsConfiguration: nil,
            pool: .init(
                maximumConnectionCount: .maximumActiveConnections(10),
                minimumConnectionCount: 0,
                connectionBackoffFactor: 2,
                initialConnectionBackoffDelay: .microseconds(100),
                connectionRetryTimeout: .milliseconds(100)
            )

Then maximumConnectionCount needs to be at least as great as the number of subscription types that the GraphQL API offers.

I'm assuming the number of Redis connections is not based on the number of clients and only on the number of unique subscription topics.

from pioneer.

d-exclaimation avatar d-exclaimation commented on July 17, 2024

The protocol handle multiplexing of subscriptions on both the client and server on but only at the network/API level.

RedisPubSub and PubSub also try to multiplex Redis subscriptions for each channel. RedisPubSub will multiplex all async stream of the same channel to 1 RediStack subscription, so basically 1 RediStack subscription for every GraphQL subscription of the same channel.

The number of connections to Redis is dependent on how RediStack handle channel subscriptions and I don't know if they make a new Redis connection for each channel subscriptions.

from pioneer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.