On Thu, Apr 23, 2009 at 9:34 PM, Tim Allen wrote:
> Tim Hughes wrote:
>> Am I completly missing the point here or is there something incorrect with
>> my code.
>
> Yes, it seems you have missed the point somewhere.
>
>> def blocking_method(self, duration=5):
>> """block the instance f
Tim Hughes wrote:
> Am I completly missing the point here or is there something incorrect with
> my code.
Yes, it seems you have missed the point somewhere.
> def blocking_method(self, duration=5):
> """block the instance for a specified duration"""
> started = time.asctime()
I am trying to understand this concept of async methods and i thought I had
it cracked with the code below but it doesn't seem to work as all the calls
to the xmlrpc server return one after the other like this:
Success:I started at Fri Apr 24 01:12:23 2009 and i slept 5 seconds then
woke at Fri Ap
BTW, below is a version of my code from yesterday that works on class
methods. I didn't write the __get__ code, but took it from a decorator
tutorial on the web.
This version works with standalone functions, and with class methods that
also use @inlineCallbacks. So you can do
class MyClass(
Hi Andrew
> "Andrew" == Andrew Francis writes:
Andrew> Why can't you have the callbacks attached to the deferred, share a flag?
Andrew> global flag
Andrew> def callback():
Andrew> global flag
Andrew> if flag == False:
Andrew> flag = True
Andrew> # do body of function
Andrew>
Hi Terry:
--- On Thu, 4/23/09, twisted-python-requ...@twistedmatrix.com
> Suppose I have a function called alertSupervisor that takes
> a string message for the supervisor and which returns a deferred. I
> want to be able to call that function from anywhere in my code, and I
> always want to ge