File tree 1 file changed +22
-8
lines changed
1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,28 @@ module SolidQueue
43
43
44
44
delegate :on_start , :on_stop , to : Supervisor
45
45
46
- # on_worker_start, on_worker_stop, on_dispatcher_start ...
47
- %w[ worker dispatcher scheduler ] . each do |process |
48
- %w[ start stop ] . each do |action |
49
- define_method ( "on_#{ process } _#{ action } " ) do |&block |
50
- # Worker.on_start(&block), Dispatcher.on_stop(&block)
51
- const_get ( process . capitalize ) . public_send ( "on_#{ action } " , &block )
52
- end
53
- end
46
+ def on_worker_start ( ...)
47
+ Worker . on_start ( ...)
48
+ end
49
+
50
+ def on_worker_stop ( ...)
51
+ Worker . on_stop ( ...)
52
+ end
53
+
54
+ def on_dispatcher_start ( ...)
55
+ Dispatcher . on_start ( ...)
56
+ end
57
+
58
+ def on_dispatcher_stop ( ...)
59
+ Dispatcher . on_stop ( ...)
60
+ end
61
+
62
+ def on_scheduler_start ( ...)
63
+ Scheduler . on_start ( ...)
64
+ end
65
+
66
+ def on_scheduler_stop ( ...)
67
+ Scheduler . on_stop ( ...)
54
68
end
55
69
56
70
def supervisor?
You can’t perform that action at this time.
0 commit comments