
Oct. 10, 2009
6:25 p.m.
Stanislav Yudin wrote:
Thanks, but how can I pass control back to calling code after starting the reactor? Or the idea is to run it in separate thread? I understand that main idea on twisted is async processing, but this time I need to block the calling code until response is received.
You already have everything set up, make your SimpleClient._on_done callback aware of what has to happen next, and if you don't know beforehand, maybe because the next thing to do depends on the result of the current, you can pass a callable to the code in charge of that decision. The only difference is that you have to break the currently blocking code into several callables. hth, Johann