For examples and more explanations, see the module level docs.
Scheduler - runs microthreads of control.
Methods defined here
Creates a scheduler object. If scheduler.run has not been set, sets it. Class initialisation ensures that this object/class attribute is initialised - client modules always have access to a standalone scheduler. Internal attributes:
Whilst there can be more than one scheduler active in the general case you will NOT want to create a custom scheduler.
A Microprocess adds itself to the runqueue using this method, using the mannerism scheduler.run._addThread(). Generally component writers should not use this method to activate a component - use the component's own activate() method instead.
Returns True if the specified microprocess is sleeping, or the scheduler does not know about it.
Returns a list of all microprocesses (both active and sleeping)
main([slowmo][,canblock]) - Scheduler main loop generator
Each cycle through this generator does two things: * one pass through all active microprocesses, giving executing them. * processing of wake/sleep requests
You can optionally slow down execution to aid debugging. You can also allow the scheduler to block if there are no active, awake microprocesses.
slowmo specifies a delay (in seconds) before the main loop is run. slowmo defaults to 0.
If canblock is True, this generator will briefly) block if there are no active microprocesses, otherwise it will return immediately (default).
This generator terminates when there are no microprocesses left (either sleeping or awake) because they've all terminated. (or because there were none to begin with!)
pauseThread(mprocess) - request to put a mprocess to sleep.
If active, or already sleeping, the specified microprocess will be put to leep on the next cycle through the scheduler.
Runs the scheduler until there are no activated microprocesses left (they've all terminated).
Think of this as bootstrapping the scheduler - after all it is a microprocess like any other, so needs something to run it!
Request to wake a sleeping mprocess, or activate a new one.
If sleeping or already active, the specified microprocess will be ensured to be active on the next cycle through the scheduler.
If the microprocess is not running yet then it will be woken if (and only if) canActivate is set to True (the default is False).
Methods inherited from Axon.Microprocess.microprocess :
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 01 Feb 2010 at 04:00:28 UTC/GMT
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved