Jido.Chat.Discord.GatewayWorker (Jido Chat Discord v1.0.0)

Copy Markdown View Source

Bridge-ingress worker for Discord gateway events.

The worker is runtime-agnostic and emits normalized payloads/events through sink_mfa. Event acquisition can be push-based (emit/2) or pull-based (event_source_mfa polling).

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

sink_mfa()

@type sink_mfa() :: {module(), atom(), [term()]}

source_mfa()

@type source_mfa() :: {module(), atom(), [term()]}

state()

@type state() :: %{
  bridge_id: String.t(),
  sink_mfa: sink_mfa(),
  sink_opts: keyword(),
  event_source_mfa: source_mfa() | nil,
  poll_interval_ms: pos_integer(),
  max_backoff_ms: pos_integer(),
  backoff_ms: pos_integer()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

emit(pid, event)

@spec emit(pid(), map() | tuple()) :: :ok

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()