Table of Contents

Class: IScheduler ./src/peak/events/interfaces.py

Time-based conditions

Base Classes   
protocols.Interface
Methods   
alarm
now
sleep
spawn
tick
time_available
timeout
until
  alarm 
alarm (
        iterator,
        timeout,
        errorType=TimeoutError,
        )

Run iterator, interrupting w/errorType after timeout secs

  now 
now ()

Return the current time

  sleep 
sleep ( secs=0 )

IEventSource that fires secs after each callback/task switch

The object returned is reusable: each time you yield it or add a callback to it, the task/callback will be delayed secs from the time that the task switch was requested or the callback added. More than one task/callback may wait on the same sleep() object, but each "wakes" at a different time, according to when it "slept".

  spawn 
spawn ( iterator )

Return a new IScheduledTask based on iterator

  tick 
tick ( stop=None )

Invoke scheduled callbacks whose time has arrived, until stop

If you may want tick to exit before all scheduled callbacks have been invoked, you may supply a mutable object as the stop parameter. If it is changed to a true value during the tick() execution, tick() will return without executing any additional callbacks. (Note that schedulers based on Twisted will raise NotImplementedError if the stop parameter is supplied.)

  time_available 
time_available ()

Return number of seconds until next scheduled callback

  timeout 
timeout ( secs )

Get an IConditional that will fire secs seconds from now

  until 
until ( time )

Get an IConditional that fires when scheduler.now() >= time


Table of Contents

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