NAME

Labrador::Common::URLAlloc

SYNOPSIS

    use Labrador::Common::URLAlloc;
    use Labrador::Common::URLAlloc::Delay;
    my $urlalloc = Labrador::Common::URLAlloc::new(
        'Labrador::Common::URLAlloc::Delay',
        $data, $urlstates, $config);
    $urlalloc->new_url('http://www.gla.ac.uk/#');
    print $urlalloc->get_url();

DESCRIPTION

Central URL queueing class, though it must be implemented. Examples of child classes are Delay, BFS, DFS.

NB: This class is abstract, and must be implemented by a child class.

METHODS

new($data, $urlstates, $config, @params)
init()
new_urls(@urls)

Maps to new_url for each @url.

new_url($url)

ABSTRACT: Must be implemented by a child class.

update_average()
last_average()
get_url()

Dequeue one URL

get_urls($count)

Dequeue upto $count URLs.

empty_queues

Empties all the queues.

next()

In Delay URLAlloc modules, returns number of seconds until next URL is ready,

queue_size()

Returns the number of URLs queued.

delay_urls(%urls)

Delay the URLs in the keys of %urls by the amount of seconds in values of %urls. Only URLAlloc implementations that implement delay handling will actually delay the URLs. Other implemetation will just enqueue the URLs to the back of the queues.

REVISION

	$Revision: 1.12 $