[Twisted-Python] dynamic FTP realm

Itamar Turner-Trauring itamar at futurefoundries.com
Sun Sep 30 06:59:30 MDT 2012


On Sun, Sep 30, 2012 at 8:38 AM, Paul Wiseman <poalman at gmail.com> wrote:

>
>  That is likely a much better idea! Will I need to use some threading if
> I'm making web calls then from list? Presumably if I don't the whole
> process will block while it's waiting for web responses?
>

If you're using Twisted's web clients (getPage or the more complex but
superior Agent) you do not need threads, Twisted will do the networking in
a non-blocking manner. E.g.

def list(self, path):
    return
twisted.web.client.getPage(...).addCallback(convertHTTPResponseToFTPListing)

-- 
Itamar Turner-Trauring, Future Foundries LLC
http://futurefoundries.com/ — Twisted consulting, training and support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20120930/57f448f9/attachment.html>


More information about the Twisted-Python mailing list