.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "Minion::Command::minion::worker 3pm" .TH Minion::Command::minion::worker 3pm "2022-10-14" "perl v5.34.0" "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" Minion::Command::minion::worker \- Minion worker command .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& Usage: APPLICATION minion worker [OPTIONS] \& \& ./myapp.pl minion worker \& ./myapp.pl minion worker \-m production \-I 15 \-C 5 \-R 3600 \-j 10 \& ./myapp.pl minion worker \-q important \-q default \& \& Options: \& \-C, \-\-command\-interval Worker remote control command interval, \& defaults to 10 \& \-D, \-\-dequeue\-timeout Maximum amount of time to wait for \& jobs, defaults to 5 \& \-h, \-\-help Show this summary of available options \& \-\-home Path to home directory of your \& application, defaults to the value of \& MOJO_HOME or auto\-detection \& \-I, \-\-heartbeat\-interval Heartbeat interval, defaults to 300 \& \-j, \-\-jobs Maximum number of jobs to perform \& parallel in forked worker processes \& (not including spare processes), \& defaults to 4 \& \-m, \-\-mode Operating mode for your application, \& defaults to the value of \& MOJO_MODE/PLACK_ENV or "development" \& \-q, \-\-queue One or more queues to get jobs from, \& defaults to "default" \& \-R, \-\-repair\-interval Repair interval, up to half of this \& value can be subtracted randomly to \& make sure not all workers repair at the \& same time, defaults to 21600 (6 hours) \& \-s, \-\-spare Number of spare worker processes to \& reserve for high priority jobs, \& defaults to 1 \& \-S, \-\-spare\-min\-priority Minimum priority of jobs to use spare \& worker processes for, defaults to 1 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Minion::Command::minion::worker starts a Minion worker. You can have as many workers as you like. .SH "WORKER SIGNALS" .IX Header "WORKER SIGNALS" The Minion::Command::minion::worker process can be controlled at runtime with the following signals. .SS "\s-1INT, TERM\s0" .IX Subsection "INT, TERM" Stop gracefully after finishing the current jobs. .SS "\s-1QUIT\s0" .IX Subsection "QUIT" Stop immediately without finishing the current jobs. .SH "JOB SIGNALS" .IX Header "JOB SIGNALS" The job processes spawned by the Minion::Command::minion::worker process can be controlled at runtime with the following signals. .SS "\s-1INT, TERM\s0" .IX Subsection "INT, TERM" This signal starts out with the operating system default and allows for jobs to install a custom signal handler to stop gracefully. .SS "\s-1USR1, USR2\s0" .IX Subsection "USR1, USR2" These signals start out being ignored and allow for jobs to install custom signal handlers. .SH "REMOTE CONTROL COMMANDS" .IX Header "REMOTE CONTROL COMMANDS" The Minion::Command::minion::worker process can be controlled at runtime through Minion::Command::minion::job, from anywhere in the network, by broadcasting the following remote control commands. .SS "jobs" .IX Subsection "jobs" .Vb 2 \& $ ./myapp.pl minion job \-b jobs \-a \*(Aq[10]\*(Aq \& $ ./myapp.pl minion job \-b jobs \-a \*(Aq[10]\*(Aq 23 .Ve .PP Instruct one or more workers to change the number of jobs to perform concurrently. Setting this value to \f(CW0\fR will effectively pause the worker. That means all current jobs will be finished, but no new ones accepted, until the number is increased again. .SS "kill" .IX Subsection "kill" .Vb 2 \& $ ./myapp.pl minion job \-b kill \-a \*(Aq["INT", 10025]\*(Aq \& $ ./myapp.pl minion job \-b kill \-a \*(Aq["INT", 10025]\*(Aq 23 .Ve .PP Instruct one or more workers to send a signal to a job that is currently being performed. This command will be ignored by workers that do not have a job matching the id. That means it is safe to broadcast this command to all workers. .SS "stop" .IX Subsection "stop" .Vb 2 \& $ ./myapp.pl minion job \-b stop \-a \*(Aq[10025]\*(Aq \& $ ./myapp.pl minion job \-b stop \-a \*(Aq[10025]\*(Aq 23 .Ve .PP Instruct one or more workers to stop a job that is currently being performed immediately. This command will be ignored by workers that do not have a job matching the id. That means it is safe to broadcast this command to all workers. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" Minion::Command::minion::worker inherits all attributes from Mojolicious::Command and implements the following new ones. .SS "description" .IX Subsection "description" .Vb 2 \& my $description = $worker\->description; \& $worker = $worker\->description(\*(AqFoo\*(Aq); .Ve .PP Short description of this command, used for the command list. .SS "usage" .IX Subsection "usage" .Vb 2 \& my $usage = $worker\->usage; \& $worker = $worker\->usage(\*(AqFoo\*(Aq); .Ve .PP Usage information for this command, used for the help screen. .SH "METHODS" .IX Header "METHODS" Minion::Command::minion::worker inherits all methods from Mojolicious::Command and implements the following new ones. .SS "run" .IX Subsection "run" .Vb 1 \& $worker\->run(@ARGV); .Ve .PP Run this command. .SH "SEE ALSO" .IX Header "SEE ALSO" Minion, Minion::Guide, , Mojolicious::Guides, .