added the twisted-based scheduler to the simple doctest sequence
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2472 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
bfe47ee6a7
commit
bbb481e237
1 changed files with 11 additions and 0 deletions
|
@ -187,6 +187,9 @@ Logging
|
||||||
Using the Twisted-based Scheduler
|
Using the Twisted-based Scheduler
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
|
By specifying the core scheduler in the agent's configuration this will be
|
||||||
|
used automatically for scheduling.
|
||||||
|
|
||||||
>>> config = '''
|
>>> config = '''
|
||||||
... controller(name='sample')
|
... controller(name='sample')
|
||||||
... scheduler(name='core')
|
... scheduler(name='core')
|
||||||
|
@ -197,11 +200,19 @@ Using the Twisted-based Scheduler
|
||||||
>>> master.scheduler
|
>>> master.scheduler
|
||||||
<cybertools.agent.core.schedule.Scheduler object ...>
|
<cybertools.agent.core.schedule.Scheduler object ...>
|
||||||
|
|
||||||
|
We trigger the controller's setup as above and enter the same
|
||||||
|
job specification.
|
||||||
|
|
||||||
>>> master.setup()
|
>>> master.setup()
|
||||||
|
|
||||||
>>> jobSpec = JobSpecification('sample', '00001', agent='sample01')
|
>>> jobSpec = JobSpecification('sample', '00001', agent='sample01')
|
||||||
>>> master.setupJobs([jobSpec])
|
>>> master.setupJobs([jobSpec])
|
||||||
|
|
||||||
|
Now the job is not executed immediately - we have to hand over control to
|
||||||
|
the twisted reactor first. The running of the reactor is simulated by
|
||||||
|
a method provided for testing.
|
||||||
|
|
||||||
>>> from cybertools.agent.tests import tester
|
>>> from cybertools.agent.tests import tester
|
||||||
>>> tester.iterate()
|
>>> tester.iterate()
|
||||||
Job 00001 on agent sample01 has been executed.
|
Job 00001 on agent sample01 has been executed.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue