View Source Lightning behaviour (Lightning v2.10.4)

Lightning keeps the contexts that define your domain and business logic.

Contexts are also responsible for managing your data, regardless if it comes from the database, an external API or others.

Summary

Types

@type release_info() :: %{
  label: String.t() | nil,
  commit: String.t() | nil,
  image_tag: String.t() | nil,
  branch: String.t() | nil,
  vsn: String.t()
}

Callbacks

@callback broadcast(
  binary(),
  {atom(), any()}
) :: :ok | {:error, term()}
@callback current_time() :: DateTime.t()
Link to this callback

local_broadcast(binary, {})

View Source
@callback local_broadcast(
  binary(),
  {atom(), any()}
) :: :ok | {:error, term()}
@callback release() :: release_info()
@callback subscribe(binary()) :: :ok | {:error, term()}

Functions

Returns the current time at UTC.

Link to this function

local_broadcast(topic, msg)

View Source
@spec release() :: release_info()