1Minion::Command::minionU:s:ewrorCkoenrt(r3i)buted Perl DMoicnuimoenn:t:aCtoimomnand::minion::worker(3)
2
3
4
6 Minion::Command::minion::worker - Minion worker command
7
9 Usage: APPLICATION minion worker [OPTIONS]
10
11 ./myapp.pl minion worker
12 ./myapp.pl minion worker -m production -I 15 -C 5 -R 3600 -j 10
13 ./myapp.pl minion worker -q important -q default
14
15 Options:
16 -C, --command-interval <seconds> Worker remote control command interval,
17 defaults to 10
18 -D, --dequeue-timeout <seconds> Maximum amount of time to wait for
19 jobs, defaults to 5
20 -h, --help Show this summary of available options
21 --home <path> Path to home directory of your
22 application, defaults to the value of
23 MOJO_HOME or auto-detection
24 -I, --heartbeat-interval <seconds> Heartbeat interval, defaults to 300
25 -j, --jobs <number> Maximum number of jobs to perform
26 parallel in forked worker processes
27 (not including spare processes),
28 defaults to 4
29 -m, --mode <name> Operating mode for your application,
30 defaults to the value of
31 MOJO_MODE/PLACK_ENV or "development"
32 -q, --queue <name> One or more queues to get jobs from,
33 defaults to "default"
34 -R, --repair-interval <seconds> Repair interval, up to half of this
35 value can be subtracted randomly to
36 make sure not all workers repair at the
37 same time, defaults to 21600 (6 hours)
38 -s, --spare <number> Number of spare worker processes to
39 reserve for high priority jobs,
40 defaults to 1
41 -S, --spare-min-priority <number> Minimum priority of jobs to use spare
42 worker processes for, defaults to 1
43
45 Minion::Command::minion::worker starts a Minion worker. You can have as
46 many workers as you like.
47
49 The Minion::Command::minion::worker process can be controlled at
50 runtime with the following signals.
51
52 INT, TERM
53 Stop gracefully after finishing the current jobs.
54
55 QUIT
56 Stop immediately without finishing the current jobs.
57
59 The job processes spawned by the Minion::Command::minion::worker
60 process can be controlled at runtime with the following signals.
61
62 INT, TERM
63 This signal starts out with the operating system default and allows for
64 jobs to install a custom signal handler to stop gracefully.
65
66 USR1, USR2
67 These signals start out being ignored and allow for jobs to install
68 custom signal handlers.
69
71 The Minion::Command::minion::worker process can be controlled at
72 runtime through Minion::Command::minion::job, from anywhere in the
73 network, by broadcasting the following remote control commands.
74
75 jobs
76 $ ./myapp.pl minion job -b jobs -a '[10]'
77 $ ./myapp.pl minion job -b jobs -a '[10]' 23
78
79 Instruct one or more workers to change the number of jobs to perform
80 concurrently. Setting this value to 0 will effectively pause the
81 worker. That means all current jobs will be finished, but no new ones
82 accepted, until the number is increased again.
83
84 kill
85 $ ./myapp.pl minion job -b kill -a '["INT", 10025]'
86 $ ./myapp.pl minion job -b kill -a '["INT", 10025]' 23
87
88 Instruct one or more workers to send a signal to a job that is
89 currently being performed. This command will be ignored by workers that
90 do not have a job matching the id. That means it is safe to broadcast
91 this command to all workers.
92
93 stop
94 $ ./myapp.pl minion job -b stop -a '[10025]'
95 $ ./myapp.pl minion job -b stop -a '[10025]' 23
96
97 Instruct one or more workers to stop a job that is currently being
98 performed immediately. This command will be ignored by workers that do
99 not have a job matching the id. That means it is safe to broadcast this
100 command to all workers.
101
103 Minion::Command::minion::worker inherits all attributes from
104 Mojolicious::Command and implements the following new ones.
105
106 description
107 my $description = $worker->description;
108 $worker = $worker->description('Foo');
109
110 Short description of this command, used for the command list.
111
112 usage
113 my $usage = $worker->usage;
114 $worker = $worker->usage('Foo');
115
116 Usage information for this command, used for the help screen.
117
119 Minion::Command::minion::worker inherits all methods from
120 Mojolicious::Command and implements the following new ones.
121
122 run
123 $worker->run(@ARGV);
124
125 Run this command.
126
128 Minion, Minion::Guide, <https://minion.pm>, Mojolicious::Guides,
129 <https://mojolicious.org>.
130
131
132
133perl v5.34.0 2022-01-20Minion::Command::minion::worker(3)