On 1/19/06, <b class="gmail_sendername">Matt Goodall</b> &lt;<a href="mailto:matt@pollenation.net">matt@pollenation.net</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I have a couple of services. The second is dependent on the first being<br>fully initialised before the second gets set up.</blockquote><div><br>&gt;&lt;snip&gt; <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In other words, what is the recommended way of starting services in the<br>correct order, including waiting for them to get initialised fully,<br>these days?</blockquote><div><br>I actually wrote something like this today, a subclass of MultiService, because my main service was dependant on there being no other services running on the same machine, and I had to implement a PB client/server to ask the other instance to shut down. This is mostly because Windows sucks, and doesn't allow me to just do a &quot;kill &lt;pid&gt;&quot; on the old one, but gave me an excuse to start the PB integration of my app. I just subclassed MultiService and reimplemented startService and stopService appropriately, not chaining my sub-service starts until I was certain I had managed to start my own service, and not stopping my service until my sub-services had stopped.
<br><br>It's a fairly simple idiom, so it's probably pretty easy to implement yourself, but I'm surprised a generic one hasn't been written yet. Similarly I've had to write a new LoopingService that runs a &quot;setup&quot; callable before looping the main service, and also has a &quot;minimum wait between calls&quot; timer going on it. None of these have been particulalrly difficult.
<br></div></div>