example-pubsub
example-pubsub copied to clipboard
Publish on npm
Is there any way this could get published on NPM? It seems pretty useful, and it seems silly for everyone to have to manually include the code in their projects.
We might want to fix https://github.com/rethinkdb/example-pubsub/issues/4 before encouraging more wide-spread use of this as an independent library by publishing on NPM, but once we have that I don't see a reason not to.
@deontologician What's your opinion on this?
I think this could be more widely used, the main issue is one of maintenance and what we imply to users if we offer it as an importable library. Right now it has no tests and the fact that RethinkDB doesn't support at-most-once semantics on changefeeds means this has the potential to be misused if we publish it indicating it's a general purpose pub-sub library.
It's not a perfect solution, but right now forcing users to include the code themselves makes it very clear you need to verify the code does what you expect. Also it's simple enough as a module that it really does act more like an example than as a finished product.
Down the road, if we implement rethinkdb/rethinkdb#4133 and some other things like changefeed durability over server restarts, I would feel more comfortable saying "OK, try replacing your message queue with this".
I updated the referenced issue in the previous comment
Fair enough. We could make it clear in the packet description that this is just a demo library, but I can see that it might not be obvious enough and could lead to using this library for applications where it doesn't properly work.
Let's wait with this for now.
@deontologician, @danielmewes: Your rational makes sense, however, the docs currently link to this project, which certainly implies this library to have a level of 'correctness'. (see here)
Basically, when looking at using changefeeds (a feature RethinkDB is promoting quite heavily), I wanted to know how they scale, found that document, read the linked pub/sub doc, and came here. To me, the docs were saying, "changefeeds might not scale to hundreds/thousands of users, unless you use this library!", but the library is telling me, "Hey, this isn't production ready, it's really just an example."
I get the dissonance, I really do, but it might be useful to be aware that users worried about scaling changefeeds are being driven to an example that's not considered production ready.
@Morgul that's definitely an error in the docs. It almost certainly should be pointing at http://rethinkdb.com/docs/rabbitmq/javascript/. The paragraph that links to this library seems to be directing the user to use a dedicated message queue to gain scalability, which this library doesn't provide even in principle. All this library is intended to do is codify a pattern where you can use publish-subscribe semantics instead of the normal changefeed semantics (i.e. it's just an alternate api)
Sorry for the confusion, I'll open an issue in our docs repo to make the distinction clearer
@deontologician Ah! That makes infinitely more sense. Thanks for the clarification.