Please help me someone. I need help , like how can i do some processing when nodejs server sends some message like:
I need to perform some task when nodejs server sends 'userOffline' event or I need to make a database entry when nodejs server sends 'authenticate' event or some messages on channel.
Is there any documentation. which can help me. I need it urgently .Please help me on this..

Thanks in advance.

Comments

julien’s picture

You can write a drupal module which include an extension for the nodejs integration module. and in this one, use node-mysql module for node and do your query on those events.

rho_’s picture

Check out hook_nodejs_message_callback() for the Drupal side, and config.sendMessageToBackend() in your server extension. It gives you a lot of flexibility in getting Node to tell Drupal what to do. Ideally you want Drupal to be doing all work on the Drupal database, and just have Node inform Drupal what changes need to be made.

I have a blog post on this very thing if you are interested. Apologies for soliciting a blog, but it directly answers this question.

Anonymous’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
Priority: Major » Normal

rho_ - no need to apologise :-)

this is not major.