
Ah ha! Of course it is so obvious now that you point it out to me. The onion endpoint parser can do this setup work in it's `listen` method which returns a `Deferred`. Thanks for your observation/advice! Cheers! David On Fri, May 2, 2014 at 3:01 PM, <exarkun@twistedmatrix.com> wrote:
On 02:53 pm, dstainton415@gmail.com wrote:
I get what you are saying... but let's back up a second; foolscap (in my branch https://github.com/david415/foolscap/tree/endpoint_descriptors_server2) uses clientFromString and serverFromString to translate twisted endpoint descriptors into endpoint objects... AND foolscap doesn't know any details about how the endpoint wire protocols work... and we'd like to keep it that way. That's really the point of this exercise.
The calling party using foolscap... in this case Tahoe-LAFS also doesn't know anything about any wire protocols. It simply receives twisted endpoint descriptors from the user and passes them to foolscap.
But Foolscap does know about *endpoints*. It knows to call `listen` or `connect` on them. Both of those methods return a `Deferred`. Any setup work you need to do you should be able to do in the implementation of those methods and however long it takes is how long it takes - just don't fire the `Deferred` until it is ready.
Jean-Paul
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python