On Thu, 19 Jan 2006 14:32:13 +0100, Eric Faurot firstname.lastname@example.org wrote:
On 1/19/06, Matt Goodall email@example.com wrote:
In other words, what is the recommended way of starting services in the correct order, including waiting for them to get initialised fully, these days?
I'd say if service B relies on servcie A, then B.startService must explicitely call A.startService().
Of course, it requires that A.startService must be a noop if called more than once.
Not a very common property of startService(). Few, if any, of the services Twisted provides offer this property.
Now for deferred, I'm not 100% sure, but I don't think there is something very wrong returning a deferred in startService.
Well, you won't get a spanking for it. Nothing pays any attention to the return value of startService, though.
privilegedStartService is run before the reactor has started, so there's no way it could support Deferreds.
startService could probably be modified to support Deferreds. MultiService is pretty lax about.... everything. I think this is just one of many possible improvements that could be made.