.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Tirex::Manager 3pm" .TH Tirex::Manager 3pm 2024-05-06 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tirex::Manager \- Rendering manager .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use Tirex::Manager; \& my $queue = Tirex::Queue\->new(); \& my $rm = Tirex::Manager\->new( queue => $queue ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The rendering manager takes jobs from the queue and runs them. It takes into account how many parallel renderings are allowed, the priority of the jobs etc. .SH METHODS .IX Header "METHODS" .ie n .SS "Tirex::Manager\->new( queue => $queue )" .el .SS "Tirex::Manager\->new( queue => \f(CW$queue\fP )" .IX Subsection "Tirex::Manager->new( queue => $queue )" Create a new rendering manager. Parameters are: .PP .Vb 1 \& queue the queue with the rendering requests (see Tirex::Queue) .Ve .ie n .SS "$rm\->add_bucket(name => $name, minprio => $minprio, maxproc => $maxproc, maxload => $maxload)" .el .SS "\f(CW$rm\fP\->add_bucket(name => \f(CW$name\fP, minprio => \f(CW$minprio\fP, maxproc => \f(CW$maxproc\fP, maxload => \f(CW$maxload\fP)" .IX Subsection "$rm->add_bucket(name => $name, minprio => $minprio, maxproc => $maxproc, maxload => $maxload)" Creates and adds a bucket with the given config. It always keeps buckets sorted according to minprio. .PP Returns the created bucket or undef on error. .ie n .SS "$rm\->set_active_flag_on_bucket($active, $bucketname)" .el .SS "\f(CW$rm\fP\->set_active_flag_on_bucket($active, \f(CW$bucketname\fP)" .IX Subsection "$rm->set_active_flag_on_bucket($active, $bucketname)" Returns true if successful, ie. the bucket did exists, false if unsuccessful. .ie n .SS $rm\->\fBget_socket()\fP .el .SS \f(CW$rm\fP\->\fBget_socket()\fP .IX Subsection "$rm->get_socket()" Return socket where the rendering manager expects responses from the rendering backends. This should be added to select calls in main loop. .ie n .SS $rm\->\fBschedule()\fP .el .SS \f(CW$rm\fP\->\fBschedule()\fP .IX Subsection "$rm->schedule()" Runs as many jobs as there are in the queue (as long as the resources don't run out). .PP This will also check for timeouts on the jobs that are currently rendering. .ie n .SS $rm\->\fBrun()\fP .el .SS \f(CW$rm\fP\->\fBrun()\fP .IX Subsection "$rm->run()" Check whether there is a job that can be rendered and that there are enough resources and then render the job. .PP Returns .PP .Vb 4 \& undef if there is no job to run \& 0 if there aren\*(Aqt enough resources \& 1 if a job was started \& 2 if a job was expired .Ve .ie n .SS $rm\->send($job) .el .SS \f(CW$rm\fP\->send($job) .IX Subsection "$rm->send($job)" Send a job to the rendering daemon. .ie n .SS $rm\->done($msg) .el .SS \f(CW$rm\fP\->done($msg) .IX Subsection "$rm->done($msg)" This is called when a message comes back from the backend that a job was rendered. .PP Returns the job or undef if the job was not found. .ie n .SS $rm\->\fBlog_stats()\fP .el .SS \f(CW$rm\fP\->\fBlog_stats()\fP .IX Subsection "$rm->log_stats()" Write statistics to log file. .ie n .SS $rm\->\fBstatus()\fP .el .SS \f(CW$rm\fP\->\fBstatus()\fP .IX Subsection "$rm->status()" Return status of the rendering manager. .ie n .SS $rm\->\fBget_load_from_uptime()\fP .el .SS \f(CW$rm\fP\->\fBget_load_from_uptime()\fP .IX Subsection "$rm->get_load_from_uptime()" Get system load by calling the 'uptime' command. This is called by \fBget_load()\fR if /proc/loadavg is not available. .ie n .SS $rm\->\fBget_load()\fP .el .SS \f(CW$rm\fP\->\fBget_load()\fP .IX Subsection "$rm->get_load()" Get current load on the machine. If /proc/loadavg is not readable for some reason, it always returns 0. .SH "SEE ALSO" .IX Header "SEE ALSO" Tirex::Manager::Test