>-----Original Message-----
>From: [email protected] [mailto:twisted-python-
>[email protected]] On Behalf Of Antonio Beamud Montero
>Sent: Tuesday, July 07, 2009 1:14 PM
>To: Twisted general discussion
>Subject: [Twisted-Python] Connecting to multiple servers
>
>Hi all:
>What's the smart way to close the reactor and exit in an app like that:
>
...you could try this (slightly modified from your example):
from twisted.internet import reactor, defer
from twisted.web.client import getPage
def gotPageCallback(page):
print "got a page!"
dlist = [getPage('http://www.google.com').addCallback(gotPageCallback)]
dlist.append(getPage('http://www.yahoo.com').addCallback(gotPageCallback
))
defer.DeferredList(dlist).addCallback(lambda _: reactor.stop())
reactor.run()
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python