.

Harvest::ClientServer - provide a multiprocess reaper

DESCRIPTION

This module provides a client/server interface to the reaper, allowing multi-procces (and even multimachine) reaping.

At present we combine both the client, and the server functionality into the one module. Eventually these should probably be split-off to form two modules, with the ``ClientServer'' module providing the glue.

The core of this module is the ``process'' function, and is the only one intended for use at present. The client and server methods will eventually allow the creation of Controllers and Reapers which run on different machines, allowing for ``gathering farms''. At present, however, this behaviour is not tested, and not supported.

METHODS

$process=new Harvest::ClientServer

Set up a client/server version of reap.

$process->server($config,$controller)

Start up a server with the given configuration, running the Harvest::Controller passed to it.

The configuration structure should contain the following keys:

SocketType
Currently only INET sockets are supported
Socket
For a INET socket, indicates the port on which to listen, for a Unix domain socket, the path to the file to be used.

$process->client($config,$mimecfg,$filecfg,$enccfg,$count)

Set up a client, with the $config being the main configuration, $mimecfg the Mimetype configuration, $filecfg the File type configuration and $enccfg the Content-Encoding configuration.

$count is used to uniquely identify this client in debug messages, and is not required if this information is not needed.

$config can contain the following keys:

# =item SocketType # # The type of the socket, at the moment only INET is supported

Socket
The socket on which to connect to the server

#=item Server # #The host on which the server is running

$process->process($config,$controller,$mimecfg,$filecfg,$enccfg)

Do a run using a set of clients and a server running on the local machine.

$config is the main configuration, $controller is a Harvest::Controller for the gathering run. $mimecfg,$filecfg and $enccfg are Mimetype, filetype and Content Encoding configuration for the reaper, respectively.

$config must contain the following:

SocketType
Socket
Reapers
The number of reapers to launch