wafer v0.1.0 Wafer.Release protocol

A protocol for releasing connections. The opposite of Conn's acquire/1.

Deriving

If you're implementing your own Conn type that simply delegates to one of the lower level drivers that you can derive this protocol automatically:

defstruct MyConn do
  @derive Wafer.Release
  defstruct [:conn]
end

If your type uses a key other than conn for the inner connection you can specify it while deriving:

defstruct MyConn do
  @derive {Wafer.Release, key: :pin_conn}
  defstruct [:pin_conn]
end

Link to this section Summary

Functions

Release all resources associated with the connection. Usually in preparation for shutdown.

Link to this section Types

Link to this section Functions

Link to this function

release(conn)

release(Wafer.Conn.t()) :: :ok

Release all resources associated with the connection. Usually in preparation for shutdown.