cult-of-coders / apollo-live-server

A set of tools to enable reactivity in Apollo alongside Meteor
MIT License
13 stars 5 forks source link

Allow for different PubSub alternatives? #4

Open ujwal-setlur opened 6 years ago

ujwal-setlur commented 6 years ago

I noticed that this package uses the default PuBSub which I believe is not recommended for production. Is there a facility to specify a different PubSub, or is this handled somewhere else in the cult-of-coders/apollo package?

theodorDiaconu commented 6 years ago

@ujwal-setlur why isn't it recommended for production ? what is recommended ?

In theory we could abstract it as a driver and allow different hookings into it, but help me get more context around this subject.

ujwal-setlur commented 6 years ago

@theodorDiaconu, from the graphql-subscription docs at https://github.com/apollographql/graphql-subscriptions/blob/master/README.md:

Note that the default PubSub implementation is intended for demo purposes. It only works if you have a single instance of your server and doesn't scale beyond a couple of connections. For production usage you'll want to use one of the PubSub implementations backed by an external store. (e.g. Redis)

theodorDiaconu commented 6 years ago

@ujwal-setlur it's no problem actually, because I'm essentially bridging it with observeChanges, so imagine that it becomes an observeChangesasyncIterator.

ujwal-setlur commented 6 years ago

Excellent! Just wanted to make sure. Thanks!

smeijer commented 4 years ago

@theodorDiaconu, have you ever considered using rawCollection().watch instead of depending on Meteor specific internals? I'm curious about the pros/cons, as it does sound interesting to decouple a bit from the Meteor Mongo driver.

theodorDiaconu commented 4 years ago

@smeijer I did consider but there were many hoops to jump especially as this was a PoC that this is possible and not very complex to do with Meteor.