Big Sister
List of all members
Requester::SlowRequester Class Reference

Super class for requesters that perform some slow, non-CPU-intense operation like starting a system command and wait for output, do some communication via TCP/IP, or the like. More...

Inheritance diagram for Requester::SlowRequester:
Requester::Requester Requester::expedap Requester::nut Requester::ping Requester::solswap

Public Object Methods

 TCP_port (scalar port)
 command (scalar command)
 timeout (scalar timeout)
 getinfo (arrayref gets, arrayref indexes)
 Called by the default request() method with gets set to the list of the variables, indexes set to the list of variable indexes to be retrieved.
 criticalness (scalar criticalness)
 returns criticalness of the handler
 consumes (scalar consumes)
 returns consumes of the handler
 startup (scalar gets, scalar indexes)
 open a connection / start a command / whatever and return a file handle
 setup (scalar srq, scalar gets, scalar indexes)
 called immediately before SlowReqWorker takes over setup() may copy any volatile data (like "env") over into the $srq object
 do (scalar srq)
 do one step - read data via $srq->read(), $srq->readln() or write data via $srq->write(), call $srq->status() if finished
 error (scalar srq)
 called if an error condition (e.g.

Additional Inherited Members

- Public Member Functions inherited from Requester::Requester
 new ()
 create a requester.
void register (list domains)
 Register a requester for one or multiple domains.
hashref request (hashref env, scalar domain, arrayref variables)
 Computes (or requests) the values of the variables listed in variables.
boolean fail_novar (boolean fail)
 Not used any more?
hashref getwalk (arrayref gets, arrayref indexes, arrayref walks)
 Similiar to getinfo(), but getwalk() is called by the default request() method if the request includes a "walk" and passes the list of variables to be walked via the walks parameter.
boolean available (hashref env)
 Determine if a requester is willing to perform (handle requests) for a given tester environment.
boolean command_available (list cmd)
 Tests if cmd is runnable - usually called by classes inherited from Requester::Requester in their available() method in order to find out if a system command they require is present or not.
int criticalness (int criticalness)
 Get/Set the criticalness of a handler.
int consumes (int consumes)
 Get/set consume level of a handler.
list probe_consumes (hashref env, arrayref variables)
 Given a list of variable names and an environment, probe_consumes() will try to determine the criticalness/consumes values for the requests that it takes to get all those variable's values.
hashref get (hashref env, arrayref variables)
 Given a list of variable names and a tester environment requests all the variables and returns the result in a hash ref.
Requester::Requester get_handler (scalar domain)
 Given the name of a domain this function searches for a request handler that is willing to perform requests for this domain.
boolean load_module (scalar module)
 Given the name of a module tries to dynamically load Requester::modulename.
protected void preexit ()
 This function is called during program shutdown.
protected hashref _get (hashref env, arrayref variables, scalar probe_only)
 Implements both the get() and probe_consumes() call.
protected void set_cache (hashref env, scalar domain, scalar name, hashref value)
 Given a domain, variable name and a value stores the value in the cache under the given domain/name.
protected void clear_cache ()
 Clear the variable cache.

Detailed Description

Super class for requesters that perform some slow, non-CPU-intense operation like starting a system command and wait for output, do some communication via TCP/IP, or the like.

Member Function Documentation

Requester::SlowRequester::command ( scalar  command)
Requester::SlowRequester::consumes ( scalar  consumes)

returns consumes of the handler

Requester::SlowRequester::criticalness ( scalar  criticalness)

returns criticalness of the handler

Requester::SlowRequester::do ( scalar  srq)

do one step - read data via $srq->read(), $srq->readln() or write data via $srq->write(), call $srq->status() if finished

Reimplemented in Requester::expedap, Requester::nut, and Requester::solswap.

Requester::SlowRequester::error ( scalar  srq)

called if an error condition (e.g.

lost connection) is detected

Requester::SlowRequester::getinfo ( arrayref  gets,
arrayref  indexes 
)

Called by the default request() method with gets set to the list of the variables, indexes set to the list of variable indexes to be retrieved.

If gets or indexes are undefined, this means that a 'walk' through all the possible variables has to be performed.

The default behaviour is to call the getwalk() method with an empty walks list. So, a requester implementation has to implement at least one of request(), getinfo() or getwalk() in order to do something useful.

Parameters
getsThe list of names of the variables that have to be retrieved.
indexesThe list of variable indexes that have to be retrieved.
Returns
A folded hashref, at the first level the hashref uses the variable index as key, the values each point to a hashref with the name of the respective variable as a key, the scalar value as the value.

Reimplemented from Requester::Requester.

Reimplemented in Requester::expedap.

Requester::SlowRequester::setup ( scalar  srq,
scalar  gets,
scalar  indexes 
)

called immediately before SlowReqWorker takes over setup() may copy any volatile data (like "env") over into the $srq object

Reimplemented in Requester::nut.

Requester::SlowRequester::startup ( scalar  gets,
scalar  indexes 
)

open a connection / start a command / whatever and return a file handle

Reimplemented in Requester::ping.

Requester::SlowRequester::TCP_port ( scalar  port)
Requester::SlowRequester::timeout ( scalar  timeout)

The documentation for this class was generated from the following file: