aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/gun/conn.ex
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-08-25 21:00:58 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-08-25 21:00:58 +0000
commit361940e119321900deca49e7b1d547b779813490 (patch)
tree10a82fafa65d9d4d6dcf4336ebbfeccdd8dae93a /lib/pleroma/gun/conn.ex
parent6dc24422dc403663f6385272f071e2223c24b2ce (diff)
parentc19d4eeaeebec3d938324fe24b67182fc5d2be4e (diff)
downloadpleroma-integration/alex.s/gun.tar.gz
Merge branch 'gun' of git.pleroma.social:alex.s/pleroma into integration/alex.s/gunintegration/alex.s/gun
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