Tirex::Manager::Bucket(3pm)

NAME
Tirex::Manager::Bucket - Rendering buckets for different priorities

SYNOPSIS
 use Tirex::Manager::Bucket;
 my $bucket = Tirex::Manager::Bucket->new( name => 'test', minprio => 1, maxproc => 8, maxload => 20 );

DESCRIPTION
To simplify the configuration of rendering parameters for different zoom levels, they are configured through Buckets. One Bucket contains the configuration for a range of zoom levels.

METHODS

  Tirex::Manager::Bucket->new( name => $name, minprio => $minprio, maxproc => $maxproc, maxload => $maxload )
Create new rendering bucket.

  $bucket->add_job($job)
Add a Tirex::Job to bucket.

  $bucket->remove_job($job)
Remove a Tirex::Job from bucket.

  $bucket->get_name()
Get name of bucket.

  $bucket->get_numproc()
Returns the number of rendering processes currently working on jobs in this bucket.

  $bucket->get_minprio()
Get minimum priority for this bucket.

  $bucket->get_maxprio()
Get maximum priority for this bucket. The maximum priority has to be set with set_maxprio() before this works.

  $bucket->set_maxprio($maxprio)
Set maximum priority for this bucket.

  $bucket->get_active()
Get active flag for this bucket.

  $bucket->set_active($active)
Set active flag for this bucket.

  $bucket->for_prio($prio)
Check whether this bucket is the right one for the given priority, ie. whether the priority is between min- and maxprio.

  $bucket->can_render($num_rendering, $current_load)
Finds out if a job in this rendering bucket can be rendered.

Returns

 1     if it can be rendered
 0     if there are already maxproc or more rendering processes
       or if bucket is not active
 undef if the load is higher or equal than maxload

  $bucket->status($num_rendering, $current_load)
Return status of bucket.