Comments (6)
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.
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.
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.
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.
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.
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)
- Public structs have no public initialisers
- After pausing the websocket connection from Apollo iOS, it can't reconnect. HOT 12
- Documentation search is pointing to incorrect path HOT 2
- Better typing for payload HOT 1
- Improvement to Test HOT 1
- Improvement to optional spec-compliant HOT 4
- Field Resolve Middleware HOT 1
- VaporMiddleware responding incorrectly to all paths HOT 7
- Plugins
- Error: 'ConcurrentResolve' is only available in macOS 12 or newer HOT 4
- TestConsumer Improvement
- subscription Precondition failed HOT 13
- Subscription via gateway HOT 3
- Improvement to spec-compliant HOT 1
- Value null in data on errors HOT 8
- GraphQL together with gRPC HOT 4
- Support for the new Swift Universal HTTP types
- Does Pioneer support subscriptions via SSE? HOT 2
- `websocketOnInit` has not been implemented
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pioneer.