Module Engine :: Class Engine
[hide private]
[frames] | no frames]

Class Engine

source code

Known Subclasses:
GameEngine.GameEngine

Main task scheduler.

Instance Methods [hide private]
 
__init__(self, fps=60, tickrate=1.0) source code
 
quit(self) source code
 
addTask(self, task, synchronized=True)
Add a task to the engine.
source code
 
removeTask(self, task)
Remove a task from the engine.
source code
 
_getTaskQueues(self, task) source code
 
pauseTask(self, task)
Pause a task.
source code
 
resumeTask(self, task)
Resume a paused task.
source code
 
enableGarbageCollection(self, enabled)
Enable or disable garbage collection whenever a random garbage collection run would be undesirable.
source code
 
collectGarbage(self)
Run a garbage collection run.
source code
 
boostBackgroundThreads(self, boost)
Increase priority of background threads.
source code
 
_runTask(self, task, ticks=0) source code
 
run(self)
Run one cycle of the task scheduler engine.
source code
Method Details [hide private]

addTask(self, task, synchronized=True)

source code 
Add a task to the engine.
Parameters:
  • task - Task to add
  • synchronized (bool) - If True, the task will be run with small timesteps tied to the engine clock. Otherwise the task will be run once per frame.

removeTask(self, task)

source code 
Remove a task from the engine.
Parameters:
  • task - Task to remove

pauseTask(self, task)

source code 
Pause a task.
Parameters:
  • task - Task to pause

resumeTask(self, task)

source code 
Resume a paused task.
Parameters:
  • task - Task to resume

enableGarbageCollection(self, enabled)

source code 
Enable or disable garbage collection whenever a random garbage collection run would be undesirable. Disabling the garbage collector has the unfortunate side-effect that your memory usage will skyrocket.

boostBackgroundThreads(self, boost)

source code 

Increase priority of background threads.

@param boost True of the scheduling of the main UI thread should  be
             made fairer to background threads, False otherwise.