ranch_connection_drainer v0.1.2 RanchConnectionDrainer View Source
Drain connections before shutting down.
If your Phoenix endpoint is MyPhoenix.Endpoint
, and you are running your server on http, then the correct value is MyPhoenix.Endpoint.HTTP
. If you are running https, then you would use MyPhoenix.Endpoint.HTTPS
.
To add this to your application, simply add {RanchConnectionDrainer, [ranch_ref: MyPhoenix.Endpoint.HTTP, shutdown: 10_000]}
to the line below MyPhoenix.Endpoint
in your Application file.
Example:
children = [
MyPhoenixProject.Endpoint,
{RanchConnectionDrainer, ranch_ref: MyPhoenixProject.Endpoint.HTTP, shutdown: 30_000}
]
Supervisor.init(children, opts)
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Link to this section Functions
Link to this function
child_spec(arg)
View Source
child_spec(arg)
View Source
child_spec(options :: keyword()) :: Supervisor.child_spec()
child_spec(options :: keyword()) :: Supervisor.child_spec()
Returns a specification to start this module under a supervisor.
See Supervisor
.