Skip to content

Commit

Permalink
Rename graceful -> graceful_stop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 26, 2024
1 parent cb54935 commit 992592d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/async/container/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Controller

# Initialize the controller.
# @parameter notify [Notify::Client] A client used for process readiness notifications.
def initialize(notify: Notify.open!, container_class: Container, graceful: true)
def initialize(notify: Notify.open!, container_class: Container, graceful_stop: true)
@container = nil
@container_class = container_class

Expand All @@ -36,7 +36,7 @@ def initialize(notify: Notify.open!, container_class: Container, graceful: true)
self.restart
end

@graceful = graceful
@graceful_stop = graceful_stop
end

# The state of the controller.
Expand Down Expand Up @@ -98,7 +98,7 @@ def start

# Stop the container if it's running.
# @parameter graceful [Boolean] Whether to give the children instances time to shut down or to kill them immediately.
def stop(graceful = @graceful)
def stop(graceful = @graceful_stop)
@container&.stop(graceful)
@container = nil
end
Expand Down Expand Up @@ -144,7 +144,7 @@ def restart

if old_container
Console.logger.debug(self, "Stopping old container...")
old_container&.stop(@graceful)
old_container&.stop(@graceful_stop)
end

@notify&.ready!
Expand Down
2 changes: 1 addition & 1 deletion test/async/container/.graceful.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def setup(container)
end
end

controller = Graceful.new(graceful: 1)
controller = Graceful.new(graceful_stop: 1)

controller.run

0 comments on commit 992592d

Please sign in to comment.