sescobb27 / socket_drano

Socket drainer for PhoenixFramework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SocketDrano

Process to gracefully drain Phoenix Socket connections at shutdown.

Plug.Cowboy.Drainer is able to handle draining of connections as they complete during a shutdown. Websockets, however, are long-lived connections which may not complete before timeout periods are reached, especially if they have a heartbeat to keep alive. This library handles both in a single dep to keep things simple.

This module provides a process that during shutdown will initiate shutdown of open Phoenix sockets.

Refer to the HexDocs for more information and examples.

Installation

If available in Hex, the package can be installed by adding socket_drano to your list of dependencies in mix.exs:

def deps do
  [
    {:socket_drano, "~> 0.5.0"}
  ]
end

About

Socket drainer for PhoenixFramework


Languages

Language:Elixir 94.3%Language:Erlang 5.7%