Wrap a generator function to return a new Task each time it's called
Usage:
def someMethod(self, whatever):
yield whatever; events.resume()
# ...
someMethod = events.taskFactory(someMethod)
Each time it's called, ob.someMethod(whatever) will return a new
events.Task that executes the code of the someMethod function on the
supplied parameter(s). Note that this may also be used in conjunction with
binding.Make , e.g.:
def aTask(self):
yield self.something; events.resume()
# ...
aTask = binding.Make( events.taskFactory(aTask) )
In this case, ob.aTask will be an events.Task that runs the
aTask method. This is often convenient to use with uponAssembly=True ,
so that the task is started as soon as the component is assembled.
|