These are chat archives for Deskshell-Core/PhoenixEngine

19th
Apr 2015
sihorton
@sihorton
Apr 19 2015 22:06
codepen.io looks good, I love jsfiddle and codepen looks the same but prettier!
cool about php7 I did not know that was coming out, looking forward to it.
Yes I have built a distributed socket server, I think it is actually quite nice to code, I use a library like socket.io or something similar so it takes care of the keep alives and all of the issues with older browsers and the like
then you basically just get an event oriented system with messages coming in and then you writing them to other channels or connections.
nodejs is really nice to write that sort of system in and the browsers having web sockets and most languages also now being able to connect it makes it a really nice way to program
it is quite like the really old school visual basic event oriented programming once again only now you are running in multiple places at the same time.
are you planning to write some kind of chat system or something else?
Ingwie Phoenix
@IngwiePhoenix
Apr 19 2015 23:16
Yes - in fact I have a chat system. I am working on a new version of my Dragon’s Inn project. The underlying CMS is codenamed BIRD. I am facing challenges that you wouldnt face if you were sane ;). PHP and Nodejs working hand-in-hand - to a point where the NodeJS request object’s most important data is given to PHP, and in an async way, PHP returns output to NodeJS and stuff goes to the client. The cool thing is, that there is a userData property now, which I use to distribute additional, pre-cache/-built data to PHP to reduce load balancing.
The PHP backend is now an evented TCP server running across multiple processes that uses the hprose protocol to talk to NodeJS just like any other service.
I contribute to hprose and also am part of the hprose organization :) https://github.com/hprose
its my biggest nodejs project ever. http://git.ingwie.me/ingwie/bird3 … but currently i am working on scaling it verticaly
HTTP is easily scaled, but socket.io is a big issue; the heartbeat (aka handshake) requires multiple requests, so I need to somehow implement http:/npmjs.org/sticky-session into my session. since it just didnt work the way I wanted, I decided to write an entirely new clustering module.
its called PowerHouse and it allows you to spawn new workers as either cluster.fork() or child_process.fork(). But the API is the same across all of them, with the difference being that a child process is it’s own master. So this thing can cluster away all that it wants and does not depend on the other cluster workers - but dies if the main process does. Its a pretty nice thing actually