LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 160 forks source link

can't expose individual worker with host and port #115

Open fabware opened 13 years ago

fabware commented 13 years ago

Hi,

I use cluster to manage socket.io workers, the requests limited to flashsocket only. Because the connection is persistent and linked with single worker( not stateless), I need a directory service to determine which workers would receive the message.

Currently, I make a random identity to each worker and make it subscribe a redis pubsub channel identified by the same worker identity to receive the message; it works, but it's awkward to complete the request-response pattern using pubsub as the communication channel.

If cluster could expose individual worker with a host & port and allow them handle request like normal standalone process. The request-response task can be much easier.

Best regards! can

tj commented 13 years ago

hmm well cluster at it's core is set up to accept() on the same socket, I don't personally have an interest in what you're suggesting because it would require a reverse proxy as well, which cluster is definitely not, but I think that's more of a fundamental socket.io issue, which I know guillermo is working on

fabware commented 13 years ago

It would be fine if there is no reverse proxy for the workers, the point is to have a request-response channel to workers in server push scenario.

I'm new to the whole socket.io thing, cluster seems the only viable solution to do socket.io clustering. For a standard socket.io-node server, expose a host and port wouldn't be problem. Consider if you guys together can make persistent connection server push easier.