summaryrefslogtreecommitdiff
path: root/lib/pleroma/gun/conn.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/gun/conn.ex')
-rw-r--r--lib/pleroma/gun/conn.ex29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/pleroma/gun/conn.ex b/lib/pleroma/gun/conn.ex
new file mode 100644
index 000000000..906607b28
--- /dev/null
+++ b/lib/pleroma/gun/conn.ex
@@ -0,0 +1,29 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Gun.Conn do
+ @moduledoc """
+ Struct for gun connection data
+ """
+ @type gun_state :: :open | :up | :down
+ @type conn_state :: :init | :active | :idle
+
+ @type t :: %__MODULE__{
+ conn: pid(),
+ gun_state: gun_state(),
+ waiting_pids: [pid()],
+ conn_state: conn_state(),
+ used_by: [pid()],
+ last_reference: pos_integer(),
+ crf: float()
+ }
+
+ defstruct conn: nil,
+ gun_state: :open,
+ waiting_pids: [],
+ conn_state: :init,
+ used_by: [],
+ last_reference: :os.system_time(:second),
+ crf: 1
+end