Table of Contents

Class: Task ./src/peak/events/event_threads.py

Thread-like "task" that pauses and resumes in response to events

Usage:

        def aGenerator(someArg):
            yield untilSomeCondition; events.resume()
            # ... do something ...

        events.Task(aGenerator(someValue))    # create a task

When created, tasks run until the first yield operation yielding an ITaskSwitch results in the task being suspended. The task will then be resumed when the waited-on event fires its callbacks, and so on.

Tasks offer an isFinished ICondition that can be waited on, or checked to find out whether the task has successfully completed. See events.ITask for more details.

Base Classes   
Observable
Methods   
__init__
_start
_uncaughtError
fromProcedure
step
  __init__ 
__init__ ( self,  iterator )

  _start 
_start ( self )

Hook for subclasses to start the task

  _uncaughtError 
_uncaughtError ( self )

Hook for subclasses to catch exceptions that escape the task

  fromProcedure 
fromProcedure ( klass,  ob )

  step 
step (
        self,
        source=None,
        event=NOT_GIVEN,
        )

See events.ITask.step


Table of Contents

This document was automatically generated on Mon Apr 22 01:11:04 2024 by HappyDoc version 2.1