| WWW-SearchBroker documentation | view source | Contained in the WWW-SearchBroker distribution. |
WWW::SearchBroker::Broker - Service functions for broker component of SearchBroker
use WWW::SearchBroker::Broker;
# Create a Broker
my $broker = new WWW::SearchBroker::Broker(...);
# Listen for requests and response
while ($broker->event_loop())
{ }
# Service functions (internal only)
my $sid = $broker->get_sid();
my $success = agent_request($sid,$agent,$query);
my $response = $self->sock_agent_request($s,$what);
my $response = get_response($file_handle);
my $is_complete = check_for_completion(@a_request);
my $success = $broker->aggregate_and_return($var,$val,$req);
Service functions for the broker component of the search broker (WWW::SearchBroker).
Creates a WWW::SearchBroker::Broker broker listening for requests
on $server_port.
The main deal -- wait for search requestions, farm them out to required agents. Returns true unless a 'QUIT' request has been received, in which case it returns false (and the script running the broker should finish).
Generate a unique key for this search (search id = sid)
Run (fork) a query using the specified agent.
Run (through socket 's') a query using the specified agent. [ Now somewhat stale, will need to be rewritten. ]
Read an agent response from the specified file handle. Return it in deserialized state (i.e. as a perl object).
Review a request object to find out if it has either finished or run out of time. A request object currently consists of a simple(?!) list consisting of filehandle, filehandle number, host, starttime and child filehandles).
Consolidate the data generated by agent sub-queries and return it to the original requestor.
For tests (e.g. t/base/search.t).
This module has only been tested on the Monash network using Monash Internet services. Since it builds off other CPAN modules, it is expected that the module will work across a variety of standards-based environments but this has not been demonstrated. The author welcomes feedback (especially patches!) for any assumptions made that don't comply with different environments.
WWW::SearchBroker, WWW::SearchBroker::Search, WWW::SearchBroker::Common, WWW::SearchBroker::Aggregator_Scorer, tests/www_searchbroker.pl.
Nathan Bailey, <nate@cpan.org>
Copyright 2002-2003 Nathan Bailey. All rights reserved. This module 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; either version 1, or (at your option) any later version.
| WWW-SearchBroker documentation | view source | Contained in the WWW-SearchBroker distribution. |