Current section

Files

Jump to
hologram lib hologram server broadcast.ex
Raw

lib/hologram/server/broadcast.ex

defmodule Hologram.Server.Broadcast do
@moduledoc """
A single broadcast entry queued on `Hologram.Server`'s `broadcasts` field.
`except` lists identities (`{:instance, id}`, `{:session, id}`, `{:user, id}`)
that should not receive the broadcast. Empty list means no exclusions.
"""
@type identity ::
{:instance, String.t()} | {:session, String.t()} | {:user, integer | String.t() | atom}
@enforce_keys [:channel, :action_name]
defstruct [:channel, :action_name, params: %{}, except: []]
@type t :: %__MODULE__{
channel: atom | tuple,
action_name: atom,
params: map,
except: [identity]
}
end