Ticket #138 (new enhancement)

Opened 1 year ago

Last modified 7 months ago

d=Tub.whenReady()

Reported by: warner Assigned to:
Priority: major Milestone: undecided
Component: usability Version: 0.4.1
Keywords: Cc:

Description

It would be handy to have a whenReady() one-shot-observer, which would fire when the Tub was running and any automatically-detected IP address listeners were configured. Callers should be able to safely call Tub.registerReference() after this fires.

This would let me replace some ugly Tahoe startup code which tries to guess when the Tub is ready by waiting for a different Service to be started and then stalling through fireEventually() a few times.

Change History

01/11/10 18:51:48 changed by warner

  • milestone changed from 0.5.0 to undecided.

I'm still not sure how exactly this ought to work.. Tub.startService() is synchronous, so waiting for it to finish is trivial if the reactor is already running. It's really a question of how you choose to compute the value that you pass into setLocation(), and whether that requires the reactor to be running first.

The Tahoe code is quite ugly, but it may need to be cleaned up first (and/or written as if Foolscap provided something nicer) before it will be clear what kind of API we should add.