adding gun adapter
[akkoma] / lib / pleroma / gun / conn.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Gun.Conn do
6 @moduledoc """
7 Struct for gun connection data
8 """
9 @type gun_state :: :up | :down
10 @type conn_state :: :active | :idle
11
12 @type t :: %__MODULE__{
13 conn: pid(),
14 gun_state: gun_state(),
15 conn_state: conn_state(),
16 used_by: [pid()],
17 last_reference: pos_integer(),
18 crf: float(),
19 retries: pos_integer()
20 }
21
22 defstruct conn: nil,
23 gun_state: :open,
24 conn_state: :init,
25 used_by: [],
26 last_reference: 0,
27 crf: 1,
28 retries: 0
29 end