Well, it depends on the service. How would you check if it's ready if you were just sitting at a terminal?
For many services, you could check for a pid file, or try to connect to it. If it succeeds, you're ready. Another option is to perhaps not start node until that other service is up. Many service managers (SMF, Upstart, etc.) have the ability to make one service depend on another. On Sat, Dec 1, 2012 at 3:55 AM, Angelo Chen <[email protected]> wrote: > hi, > > what is the best way to check if other service is ready(ex:redis) > before: > http.createServer(function(req, res) ? thanks, > > angelo > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
