Posted by Anonymous on January 31, 2011 at 8:25am
I've now implemented a simple API for other modules to use Node.js functionality from Nodejs module.
Still pre-alpha code, but would love to get some more eyes on it, feedback more than welcome.
Comments
my eyes on it now
I have downloaded. But no installed.
I read the source code but didn't find what is use of this module. Can you point it for me ?
I am beginner and interesting nodejs.
thank your module
By the way, Where can i get socket IO package?
Learn everyday
I agree with JackeyChan. As
I agree with JackeyChan. As someone who is interested and learning about the Node.js project, I'm interested in hearing what use cases you envision for node.js integration module.
I guess what I'm saying is,
I guess what I'm saying is, in short, proof of what concept? :)
socket.io project page:
socket.io project page: http://socket.io/
nodejs drupal module code: http://drupal.org/project/nodejs
there's an example module in there that consumes the nodejs.module API.
let me know if you have any specific questions, development is moving fast, all patches/features suggestions etc are welcome.
Proof of what concept?
I think what we're asking is: Proof of What Concept? Could you explain your vision? Are you going to allow execution of something on a node? Run Drupal under node? ??? Please explain your vision.
ah, i see. silly me, sorry i
ah, i see. silly me, sorry i misunderstood the question.
the concept is - use drupal as a publisher of realtime information, but pipe that information to clients via node.js.
using Drupal directly for realtime data sucks.
either you use polling, which eat servers, or you use push (via websockets, flash sockets, long polling, etc), but then you have a fat drupal process just sitting there, and you eat servers just as quickly.
what nodejs.module seeks to do is:
a) keep the 'always open' socket handling with node.js, because node.js is able to handle large numbers of these without much fuss. node.js code does little more than this, its dumb by design
b) keep all the smarts with Drupal, e.g., clients connect to node.js, but auth is handled by Drupal, content creation is handled by Drupal
c) allow other modules to easily use nodejs.module's API to send realtime/push information to browsers
is that a bit clearer?
Cool! Thanks for the
Cool! Thanks for the explanation. I'm working on a module called Sensor Hub that pulls in data from Sensor Boards (ex. Arduino) in realtime (ideally). I might have a use case for the node.js integration down the line but right now I'm focusing on a Feeds module integration.
My question is at a
My question is at a conceptual level. I am not looking for technical detail; In the above architecture, How is data passed between Drupal and nodejs? Does node.js approximately replace/precede Apache in the "LAMP" stack? How does a module or a developer configure which requests are handled by node.js instead of Apache? How does node.js "escalate" a request to Drupal and determine if that is even necessary? Does it escalate the request to Drupal through Apache or bypass it? Does node.js parse and execute PHP?
Bevan/
examples ??
Agree with Bevan.
I'm using Drupal to control my home automation system.
And i think that node.js is ideal to display data in realtime.
Are there some examples / Howto's about using this API ?
Documentation
Is there any documentation available outside of the codebase? Doxygen or equivalent would be fine. It would be nice to be able to see what the method/function calls look like with a little bit of commentary.
For others who might be wondering
For anyone who would like a tiny bit more technical detail... If I understand this correctly, the way the node.js module works is by creating another server listening on port 8080 using node.js and the popular Express framework. At the same time, it also creates endpoints for the node.js server to talk to the main Drupal server (usually listening on port 80).
As @bejeebus mentions above, this means that you can offload things that need to be 'realtime' to the node.js server, and the drupal module gives you a nice way to link it all together.
The other nice thing that the module provides is a bunch of useful submodules that provide some building blocks to piece stuff together. For example, if I read it right, the nodejs_watchdog module lets you 'listen' to the watchdog log and 'do stuff' when particular log messages come through.
Have I got that right?