direct.showbase.Job

from direct.showbase.Job import Job, TestJob, addTestJob

Inheritance diagram

Inheritance diagram of direct.showbase.Job

class Job(name)[source]

Bases: DirectObject

Base class for cpu-intensive or non-time-critical operations that are run through the JobManager.

To use, subclass and override the run() method.

Continue = None

yield None is acceptable in place of yield Job.Continue

Done = <object object>

Yielded from the run() generator method when the job is done.

Priorities = <direct.showbase.PythonUtil.ScratchPad object>
Sleep = <object object>

Yield any remaining time for this job until next frame.

__init__(self, name)[source]
destroy(self)[source]
finished(self)[source]
getFinishedEvent(self)[source]
getJobName(self)[source]
getPriority(self)[source]
isFinished(self)[source]
printingBegin(self)[source]
printingEnd(self)[source]
resume(self)[source]

Called every time JobManager is going to start running this job.

run(self)[source]

This should be overridden with a generator that does the needful processing.

yield Job.Continue when possible/reasonable, and try not to run longer than the JobManager’s timeslice between yields.

When done, yield Job.Done.

setPriority(self, priority)[source]
suspend(self)[source]

Called when JobManager is going to stop running this job for a while.

class TestJob[source]

Bases: Job

__init__(self)[source]
run(self)[source]
addTestJob()[source]