<html><body>On 01:48 am, rampeters@gmail.com wrote:<br />&gt;I am looking for some guidance on how to poll a resource on another<br />&gt;computer using twisted. &#160;Poll a remote resource, if a task is<br />&gt;available, I need to perform it on the twisted machine, not on the<br />&gt;remote resource machine. &#160;Can anyone tell me how I can do this.<br />&gt;Twisted event loops only listens for incoming. &#160;I need to go out and<br />&gt;check the resource and begin processing.<br /><br />This question is extremely open-ended. &#160;I could think of maybe 50 ways to implement this functionality as specified, and I'm not sure exactly what you're thinking.<br /><br />Twisted does listen for incoming *events*, but I think what you mean is that it listens only for incoming *connections*. &#160;If what you mean is simply "how do I connect to another host as a client", see this document:<br /><br />&#160; &#160; http://twistedmatrix.com/projects/core/documentation/howto/clients.html<br /><br />If what you mean is "how do I do something, such as check a remote resource, periodically", you might want to use Twisted's LoopingCall object:<br /><br />&#160; &#160; http://twistedmatrix.com/documents/current/api/twisted.internet.task.LoopingCall.html<br /><br />If what you mean is "how do I stop my program and wait for something to happen", you don't need to. &#160;Simply ask the remote computer about the resource you are polling (by establishing a client connection and writing some bytes to it, for example), and then wait for the reactor to tell you that it has responded. &#160;If you want to establish a timeout, set up a timed call using reactor.callLater, and cancel it if the response arrives first.<br /><br /></body></html>