Padre::SlaveDriver - Padre thread spawner
use Padre::SlaveDriver; my $sd = Padre::SlaveDriver->new(); my $slave_thread = $sd->spawn($taskManager);
Padre uses threads for asynchronous background operations which may take so long that they would make the GUI unresponsive if run in the main (GUI) thread.
This class is a helper that will spawn new worker on demand. It keeps a single model thread around that was (or should have been) created very early in the startup process of Padre. Therefore, the threads' memory consumption will be significantly lower than if one created new worker (slave) threads from the main Padre thread.
Maintainer note: This module must not load any other part of Padre and should generally be kept low on memory overhead.
new
The constructor returns a Padre::SlaveDriver object. Padre::SlaveDriver is a singleton. An object is instantiated when the editor object is created.
Padre::SlaveDriver
Takes the Padre::TaskManager object as argument. Returns a new worker thread object.
Returns the task queue (Thread::Queue object) for use by the Padre::TaskManager for passing processing tasks to the worker threads.
Thread::Queue
This queue is instantiated by the slave driver because it needs to be available early for passing to the master thread.
Reaps the master thread. Will be called by the TaskManager on shutdown and on global destruction.
What if the computer can't keep up with the queued jobs? This needs some consideration and probably, the schedule() call needs to block once the queue is "full". However, it's not clear how this can work if the Wx MainLoop isn't reached for processing finish events.
schedule()
MainLoop
Polling services aliveness in a useful way, something a Wx::Taskmanager might like to display. Ability to selectively kill tasks/services
Wx::Taskmanager
The base class of all "work units" is Padre::Task.
Steffen Mueller smueller@cpan.org
smueller@cpan.org
Copyright 2008-2010 The Padre development team as listed in Padre.pm.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
To install Padre, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Padre
CPAN shell
perl -MCPAN -e shell install Padre
For more information on module installation, please visit the detailed CPAN module installation guide.