Upstart is the new event-based *nix startup daemon that’s all the rage these days. It is also a little event-based startup manager I cooked up for Javascript applications. Basically, chunks of application are started up in an order that satisfies all dependencies.
What’s the use of an event-based startup manager if Javascript is largely linear? It’s pretty pointless at the moment, I suppose. But with the advent of multithreaded Javascript, there might be some value in controlling code execution this way.
The code can be downloaded here.
Oh, and happy July 4th to those who celebrate.
Can’t this also be used to shutdown applications when their work is done? Since it uses javascript it would be easy……….
It would be useful for servers that have to run specific applications at certain times but would there be any adverse affects?
All it does is call functions, so if you have startup and shutdown methods, you can hook them all up to the event manager.
But remember, Javascript is clientside code… but I’m sure this would work just as well in SJS (serverside Javascript).
Did you try multithreading via Google Gears?
It would be interesting if you could set method: to the location of an external JS file, then you have a pretty cool dependency-handling javascript loader.
You know… that’s not a bad idea. It should be pretty simple to load a piece of external code by adding a script tag. And instead of a name, one could have a URL and POST parameters. Hmm…