by
Hido Hasimbegovic >> Mon, 5 Feb 2001 3:16:37 GMT
Have you considered something a long the lines of the following: using a single communication or router process, which accepts connections, receives/sends messages and then passes them to 'worker processes' via an internal message queue?
Yes, although I was hoping to avoid the potential complexities and overhead of needing to code my own Server->Worker Heirachy.
But that seems like the best option since I have been thwarted in my original attempts to do something along the lines of 'connectionObject.listenContinuousThenStartAppMethodWithConnectionObject("My Schema","MyApp",ConnectionObject) '
Yes, although I was hoping to avoid the potential complexities and overhead of needing to code my own Server->Worker Heirachy.
But that seems like the best option since I have been thwarted in my original attempts to do something along the lines of 'connectionObject.listenContinuousThenStartAppMethodWithConnectionObject("My Schema","MyApp",ConnectionObject) '
Too bad it takes Jade about 30 mins to spin off a process, eh
. I've had the same problem. Wouldn't it be nice if Jade supported light-weight worker threads which would be under programmer's control. I know there are a number of constraints that Jade faces due to its acrhitecture, but a bit of wishful thinking never hurt anyone.
Anyway, the way I've implemented a simple server/workers concept is as follows:
-start server with continuous listener,
-start a number of worker apps (create a pool)
-using notification, pass processing of any new connection to a worker app -if pool reaches critically low nr of free workers, start some more -conversly, if there are too many idle worker apps, shut down a few
-when notifying a worker app to process a request, pass reference to tcp object,
so that the worker app can send reply.
Works alright, although I'm not sure Jade has been designed to do these kind of things ...
Cheers,
Hido