Table of Contents

Class: taskFactory ./src/peak/events/

Wrap a generator function to return a new Task each time it's called


        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.

Base Classes   
__call__ (

Table of Contents

This document was automatically generated on Mon Jul 22 01:11:17 2019 by HappyDoc version 2.1