Class: cogen.core.schedulers.Scheduler

Basic deque-based scheduler with timeout support and primitive prioritisaiton parameters.

Usage: Scheduler(reactor=DefaultReactor, default_priority=priority.LAST, default_timeout=None)
  • reactor: a reactor class to use
  • default_priority: a default priority option for operations that do not
set it. check priority.
  • default_timeout: a default timedelta or number of seconds to wait for
the operation

Methods

add (self, coro, args=(), kwargs={}, first=True)

add_timeout (self, op, coro, weak_timeout)

handle_timeouts (self)

next_timer_delta (self)

process_op (self, op, coro)

run (self)

This is the main loop. This loop will exit when there are no more coroutines to run or stop has been called.

run_timer (self)

stop (self)