[Twisted-Python] returning value after addCallback
Ladislav Andel
ladaan at iptel.org
Sun Aug 12 05:01:42 EDT 2007
Phil Mayers wrote:
>> test = PingTracker()
>> d = test.check(domain[0], test_opts)
>>
>> print d # this returns Deferred...
>>
>> test.SipCallback() # this returns None
>>
>
> Yes, because no Twisted code has run yet
>
>
>> reactor.run()
>>
>
> ...because you haven't started the reactor.
>
>
So how should I run reactor then ?
Yes, I have difficulties to get on the right "twisted track".
I've seen many examples but probably didn't grasp the way how it works.
Lada
> I don't think you properly understand how Twisted works. Your code is
> executed in response to events (packets being received, timers expiring,
> reactor startup/shutdown events). The reactor runs the event loop.
>
>
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
More information about the Twisted-Python
mailing list