How to stop Bandit?
riccardomanfrin opened this issue · 2 comments
Hello,
I'm using Bandit 1.0.0-pre.16
I can start it with the conventional childspec
{ Bandit,
scheme: :https,
ip: ip,
thousand_island_options: [
num_acceptors: amount,
],
...
The documentation mentions a lot of ways to start it, and is backed by a lot of ways of starting ThousandIsland
, but is there a way to stop it (just like provided by cowboy:stop_listener)?
Yep! You can stop bandit either via standard supervision patterns (at the top level, a thousand island server instance is just a Supervisor process?, or via https://hexdocs.pm/thousand_island/ThousandIsland.html#stop/2 if you want to be explicit about it.
Ok.. I think I'm getting the direction..
The ThousandIsland.stop is not an option cause I don't want to keep track of an "ephimeral" pid pretty much.
So I will have to dedicate a Supevisor
to wrap the Bandit process tree (I'm having just one super simple flat supervisor managing Bandit and few other processes atm.
EDIT:
Yes worked ;)