Opened 15 years ago

Closed 9 years ago

#138 closed enhancement (wontfix)

d=Tub.whenReady()

Reported by: Brian Warner Owned by:
Priority: major Milestone: undecided
Component: usability Version: 0.4.1
Keywords: Cc:

Description (last modified by Brian Warner)

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 (2)

comment:1 Changed 15 years ago by Brian Warner

Milestone: 0.5.0undecided

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.

comment:2 Changed 9 years ago by Brian Warner

Description: modified (diff)
Resolution: wontfix
Status: newclosed

I'm giving up on this, because it's better to not automatically detect IP addresses. And if you don't auto-detect them (and decide on your tub.setLocation() ahead of time), then you don't need to wait for anything to be "ready" before you can do registerReference().

#252 is related.

Note: See TracTickets for help on using tickets.