5 ms·
Nodule: A Node.js Pub-Sub Key-Value Store in 185 Lines
- jashkenas 16y agoJust for kicks, here's what the straight port of Nodule.js looks like in CoffeeScript. http://gist.github.com/364845 http://gist.github.com/364845 A little clearer, about 25% shorter, pretty fun.
- lonestar 16y agoInteresting. I haven't played with CoffeeScript before, I'll have to try it out. I stuck to straight JS since I'd like the source to be simple for most developers to understand.
- zackham 16y agoI'm working to accomplish something similar with Redis's pub/sub and Rosepad Socket.IO for handling persisting the client connection. If anyone has ideas questions or suggestions related to this strategy or these technologies I'd love to talk, email is in my profile.
- BrianHammond 16y agoI am doing something similar with my redis-node-client as a base.
- juvenn 16y agoRedis has Pub/Sub support as well: http://code.google.com/p/redis/wiki/PublishSubscribe http://code.google.com/p/redis/wiki/PublishSubscribe And I think their APIs (limited to pub/sub) are very alike, kinda cool!
- exit 16y agoi'm pretty clueless - what are some examples this could be deployed for?
- zackham 16y agoIt is just a form of message passing / broadcasting. Simplest example is chat. More complex example is Google Wave.
- BrianHammond 16y agoNice, good to see more people coming to Node.js. These things are like the modern "Hello, World!". Here's one I hacked up in 10 minutes. It's 40 LOC. http://gist.github.com/366590 http://gist.github.com/366590 The big problem with this is that it's just one server. I'm working on something called "NodeRed" (har har) that lets one scale out the frontend using Redis for communication. It's generic enough to do PUBSUB, chat, games, etc. Here's an overview. http://fictorial.com/NodeRed.png http://fictorial.com/NodeRed.png I developed the/a Node.js client for Redis if you care to dive into this stuff: http://github.com/fictorial/redis-node-client http://github.com/fictorial/redis-node-client
- BrianHammond 16y agoI just uploaded the first version of NodeRed: http://github.com/fictorial/nodered http://github.com/fictorial/nodered