towhee.engine.task_scheduler.BasicScheduler

class towhee.engine.task_scheduler.BasicScheduler(task_execs: List[ThreadPoolTaskExecutor], threshold: int)[source]

Bases: TaskScheduler

Basic scheduler.

This scheduler will start all ops, and has no scheduling logic, so the schedule_step does nothing.

Methods

join

register

Register a virtual subclass of an ABC.

schedule_forever

Runs the a single schedule step in a loop.

schedule_step

Scheduler:

stop

__init__(task_execs: List[ThreadPoolTaskExecutor], threshold: int)[source]
register(graph_ctx)[source]

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

schedule_forever(sleep_ms)

Runs the a single schedule step in a loop.

sleep_ms: (int)

Milliseconds to sleep after completing a single scheduling step.

schedule_step()[source]
Scheduler:
  1. Remove the graph which is finished.

  2. Call df gc.