On Sun, Sep 30, 2012 at 8:38 AM, Paul Wiseman <poal...@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.
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to