Skip to content

Commit

Permalink
Add Grizzly.stop_zipgateway/0
Browse files Browse the repository at this point in the history
  • Loading branch information
bjyoungblood committed Jul 11, 2023
1 parent 91aef7e commit 3fed7d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/grizzly.ex
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ defmodule Grizzly do
@spec restart_zipgateway :: :ok
defdelegate restart_zipgateway(), to: Grizzly.ZIPGateway.Supervisor

@doc "Stops the Z/IP Gateway process if it is running."
@spec stop_zipgateway :: :ok
defdelegate stop_zipgateway(), to: Grizzly.ZIPGateway.Supervisor

@doc "Get the current inclusion status."
@spec inclusion_status() :: Inclusions.status()
defdelegate inclusion_status(), to: Inclusions.StatusServer, as: :get
Expand Down
7 changes: 7 additions & 0 deletions lib/grizzly/zipgateway/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ defmodule Grizzly.ZIPGateway.Supervisor do
:ok
end

@doc "Stops the Z/IP Gateway process if it is running."
@spec stop_zipgateway() :: :ok
def stop_zipgateway() do
_ = Supervisor.terminate_child(__MODULE__, MuonTrap.Daemon)
:ok
end

@spec start_link(Options.t()) :: Supervisor.on_start()
def start_link(options) do
Supervisor.start_link(__MODULE__, options, name: __MODULE__)
Expand Down

0 comments on commit 3fed7d0

Please sign in to comment.