I have a chat app for mobile devices which uses a php REST service to communicate.
Everything works fine but would like to use long poll to query new messages to reduce battery consumption and bandwidth on devices.
I have investigated a bit and seems that apache is not well suited for this type of requests because of its threading model.
Node.js instead seems to use event driven execution which perfectly fits this use but I would like to keep my php service, so was thinking about create a node server which handles the long poll and it polls the php service until data is available (both services will be on openshift)
So, the questions:
1-is there a better way to do this?
2-if no, how it should be handled on node server (code examples please, not pseudo code, I know i must retain the connection, create an async task to poll, etc etc, but its my first program for node.js and i am a bit lost)
Thanks.
Edit
Use of Push services are discarded because mobile app is distributed in house, so no gcm nor Apple push