Skip to content

Commit edc82dd

Browse files
committed
Add description for before_pause and after_pause to HOOKS doc
1 parent ee1ab81 commit edc82dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/HOOKS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ The `after_fork` hook will be run in the child process and is passed
3838
the current job. Any changes you make, therefor, will only live as
3939
long as the job currently being processes.
4040

41+
You can also run a hook both before a worker pauses (`before_pause`),
42+
and after it is paused (`after_pause`). Each case the block will be
43+
passed the worker that is pausing or unpausing, respectively:
44+
45+
Resque.before_pause do |worker|
46+
puts "It looks like #{worker} is now paused!"
47+
end
48+
49+
50+
Resque.after_pause do |worker|
51+
puts "Whew, back to work for #{worker}!"
52+
end
53+
4154
All worker hooks can also be set using a setter, e.g.
4255

4356
Resque.after_fork = proc { puts "called" }

0 commit comments

Comments
 (0)