File tree Expand file tree Collapse file tree 1 file changed +41
-41
lines changed
lib/solid_queue/processes Expand file tree Collapse file tree 1 file changed +41
-41
lines changed Original file line number Diff line number Diff line change @@ -18,60 +18,60 @@ def stop
18
18
@thread &.join
19
19
end
20
20
21
- private
22
- DEFAULT_MODE = :async
21
+ private
22
+ DEFAULT_MODE = :async
23
23
24
- def mode
25
- ( @mode || DEFAULT_MODE ) . to_s . inquiry
26
- end
24
+ def mode
25
+ ( @mode || DEFAULT_MODE ) . to_s . inquiry
26
+ end
27
27
28
- def boot
29
- register_signal_handlers if supervised?
30
- SolidQueue . logger . info ( "[SolidQueue] Starting #{ self } " )
31
- end
28
+ def boot
29
+ register_signal_handlers if supervised?
30
+ SolidQueue . logger . info ( "[SolidQueue] Starting #{ self } " )
31
+ end
32
32
33
- def start_loop
34
- if mode . async?
35
- @thread = Thread . new { do_start_loop }
36
- else
37
- do_start_loop
33
+ def start_loop
34
+ if mode . async?
35
+ @thread = Thread . new { do_start_loop }
36
+ else
37
+ do_start_loop
38
+ end
38
39
end
39
- end
40
40
41
- def do_start_loop
42
- loop do
43
- break if shutting_down?
41
+ def do_start_loop
42
+ loop do
43
+ break if shutting_down?
44
44
45
- wrap_in_app_executor do
46
- run
45
+ wrap_in_app_executor do
46
+ run
47
+ end
47
48
end
49
+ ensure
50
+ run_callbacks ( :shutdown ) { shutdown }
48
51
end
49
- ensure
50
- run_callbacks ( :shutdown ) { shutdown }
51
- end
52
52
53
- def shutting_down?
54
- stopping? || supervisor_went_away? || finished?
55
- end
53
+ def shutting_down?
54
+ stopping? || supervisor_went_away? || finished?
55
+ end
56
56
57
- def run
58
- raise NotImplementedError
59
- end
57
+ def run
58
+ raise NotImplementedError
59
+ end
60
60
61
- def stopping?
62
- @stopping
63
- end
61
+ def stopping?
62
+ @stopping
63
+ end
64
64
65
- def finished?
66
- running_inline? && all_work_completed?
67
- end
65
+ def finished?
66
+ running_inline? && all_work_completed?
67
+ end
68
68
69
- def all_work_completed?
70
- false
71
- end
69
+ def all_work_completed?
70
+ false
71
+ end
72
72
73
- def running_inline?
74
- mode . inline?
75
- end
73
+ def running_inline?
74
+ mode . inline?
75
+ end
76
76
end
77
77
end
You can’t perform that action at this time.
0 commit comments