mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-05-03 07:50:37 +00:00
24 lines
858 B
Elixir
24 lines
858 B
Elixir
defmodule WandererApp.Test.PubSub do
|
|
@moduledoc """
|
|
Behaviour for PubSub functions used in the application.
|
|
This allows mocking of PubSub calls in tests.
|
|
"""
|
|
|
|
@callback broadcast(
|
|
server :: module() | pid(),
|
|
topic :: String.t(),
|
|
message :: any()
|
|
) ::
|
|
:ok | {:error, term()}
|
|
@callback broadcast!(
|
|
server :: module() | pid(),
|
|
topic :: String.t(),
|
|
message :: any()
|
|
) ::
|
|
:ok | {:error, term()}
|
|
@callback subscribe(topic :: String.t()) :: :ok | {:error, term()}
|
|
@callback subscribe(module :: atom(), topic :: String.t()) :: :ok | {:error, term()}
|
|
@callback unsubscribe(topic :: String.t()) :: :ok | {:error, term()}
|
|
@callback unsubscribe(module :: atom(), topic :: String.t()) :: :ok | {:error, term()}
|
|
end
|