Skip to content

Commit b067d07

Browse files
Expose more internals for testing purposes.
1 parent f43693c commit b067d07

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

lib/async/container/controller.rb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,30 @@ class Controller
2424
# Initialize the controller.
2525
# @parameter notify [Notify::Client] A client used for process readiness notifications.
2626
def initialize(notify: Notify.open!, container_class: Container, graceful_stop: true)
27-
@container = nil
27+
@notify = notify
2828
@container_class = container_class
29+
@graceful_stop = graceful_stop
2930

30-
@notify = notify
31+
@container = nil
3132
@signals = {}
3233

3334
self.trap(SIGHUP) do
3435
self.restart
3536
end
36-
37-
@graceful_stop = graceful_stop
3837
end
3938

39+
# The notify client used by the controller.
40+
attr :notify
41+
42+
# The container class used by the controller.
43+
attr :container_class
44+
45+
# The graceful stop flag used by the controller.
46+
attr :graceful_stop
47+
48+
# The current container being managed by the controller.
49+
attr :container
50+
4051
# The state of the controller.
4152
# @returns [String]
4253
def state_string
@@ -60,9 +71,6 @@ def trap(signal, &block)
6071
@signals[signal] = block
6172
end
6273

63-
# The current container being managed by the controller.
64-
attr :container
65-
6674
# Create a policy for managing child lifecycle events.
6775
# Can be overridden by a sub-class to provide a custom policy.
6876
# @returns [Policy] The policy to use for the container.

0 commit comments

Comments
 (0)