NAME

Geo::Coder::Many::Scheduler::Selective - Scheduler that times out bad geocoders

DESCRIPTION

This scheduler wraps another scheduler, and provides facilities for disabling various geocoders based on external feedback (e.g. limit exceeded messages)

In particular, if a geocoder returns an error, it is disabled for a timeout period. This period increases exponentially upon each successive consecutive failure.

METHODS

new

Constructs and returns an instance of the class. Takes a reference to an array of {name, weight} hashrefs, and the name of a scheduler class to wrap (e.g. Geo::Coder::Many::Scheduler::OrderedList)

reset_available

Wrapper method - passes the reset on to the wrapped scheduler.

get_next_unique

Retrieves the next geocoder from the internal scheduler, but skipping over it if it isn't acceptable (e.g. being timed out)

next_available

Returns undef if there are no more geocoders that will become available. Otherwise it returns the time remaining until the earliest timeout-end arrives.

process_feedback

Recieves feedback about geocoders, and sets/clears timeouts appropriately.

INTERNAL METHODS

_increase_timeout

Increases the timeout for the specified geocoder, according to the base_timeout and timeout_multiplier instance variables.

_clear_timeout

Clears the timeout for the specified geocoder.