Wafer.Release protocol (wafer v1.0.1)

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

deriving

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

Types

t()

All the types that implement this protocol.

Functions

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

Link to this section Types

Specs

t() :: term()

All the types that implement this protocol.

Link to this section Functions

Specs

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

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