NAME

 zebot::DB::DBspawner


DESCRIPTION

zebot::DB::DBspawner module, fires up a number of worker processes that connect to the database, and then forks off with the incoming tasks.


COPYRIGHT and LICENCE

  Copyright (c) 2002 Bruno Boettcher
  DB::DBspawner.pm is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; version 2
  of the License.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


Methods of this class

CTOR
instantiation of the emoteparser

init
Initiaize, means set up this module

_start
start up to MAX_CONCURRENT_TASKS workers, make the connect to the database and store theyre references for later use.

we use 3 stacks here: the stack of DBI helpers the stack of waiting requests the stack of running forks

the resultAsReference is set automaticly for the DBI helpers, to signalize to send the data as storable objects instead of plain references

doQuery
can be invoqued with a request or without. If no request is given, a try is made to fetch one from the stack of waiting ones....

otherwise this takes as arguments the query object, the session the results should be posted back and the event that should be invoqued on that session.

if a helper is available a fork is called adn the data transmitted to the forked off code, otherwise the request is stored.

batch
here a whole transaction is send in one go to the helper, since it is forked off, no splitting of the job is required...

handle_task_result
Handle information returned from the task. Since we're using POE::Filter::Reference, the $result is however it was created in the child process. its a hash reference following the format requested in DB::Helper

handle_task_debug
Catch and display information from the child's STDERR. This was useful for debugging since the child's warnings and errors were not being displayed otherwise.

handle_task_done
A job completed, push the returning helper onto the stack of available workers, check for waiting requests and eventuall fire off an doQuery or batch event to start their processing.

sysdata
attribute getter previously provided by ObjecTemplate

print
delegator, to make a copy of the console stream to a file, for debugging purposes only, since somehow the STDOUT gets swallowed up for some cases....

shutdown
close down the activity for a safe shutdown

_stop
close down this thing

prepare
prepare a sql statement for further refinement its a dirty hack at the moment, since if uses either a free Helper, or the last (still working) one from the list of helpers.... doesn't seem to be a problem at the moment, but htere's surely a more elegant way to do this ...


AUTHOR

Bruno Böttcher <bboett at adlp.org>


SEE ALSO

zebot home page http://www.freesoftware.fsf.org/zebot/ POD documentation of zebot