types: add @type t to last two untyped GenServer structs
Every other defstruct in the app already has a @type t declaration; these two GenServer states were the last holdouts. Declaring t here means the whole codebase is ready for the typed-struct milestone of Elixir's set-theoretic type system (the next phase after the inference pass already shipping in 1.19).
This commit is contained in:
parent
3a163028e3
commit
256e61ec76
2 changed files with 13 additions and 0 deletions
|
|
@ -22,6 +22,13 @@ defmodule Aprsme.ConnectionMonitor do
|
|||
:last_check
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
node_stats: %{optional(node()) => map()},
|
||||
local_connections: non_neg_integer(),
|
||||
draining: boolean(),
|
||||
last_check: integer()
|
||||
}
|
||||
|
||||
def start_link(opts) do
|
||||
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@ defmodule AprsmeWeb.MapLive.PacketBatcher do
|
|||
|
||||
defstruct [:parent_pid, :buffer, :timer_ref]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
parent_pid: pid(),
|
||||
buffer: [map()],
|
||||
timer_ref: reference() | nil
|
||||
}
|
||||
|
||||
@doc """
|
||||
Start the packet batcher for a LiveView process.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue