Jido.Messaging.BridgeServer (Jido Messaging v1.0.0)

Copy Markdown View Source

Runtime bridge process for a single configured bridge.

Holds resolved bridge config and owns adapter listener child specs.

Summary

Functions

Returns a specification to start this module under a supervisor.

Records the latest bridge error without crashing the caller.

Records successful inbound activity for a running bridge.

Records successful outbound activity for a running bridge.

Starts a bridge runtime process for a configured bridge.

Returns a status snapshot for the bridge process.

Returns the running bridge process for bridge_id, if one is registered.

Types

state()

@type state() :: %{
  instance_module: module(),
  bridge_id: String.t(),
  config: Jido.Messaging.BridgeConfig.t(),
  listener_supervisor: pid() | nil,
  last_ingress_at: DateTime.t() | nil,
  last_outbound_at: DateTime.t() | nil,
  last_error: term() | nil
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

mark_error(instance_module, bridge_id, reason)

@spec mark_error(module(), String.t(), term()) :: :ok

Records the latest bridge error without crashing the caller.

mark_ingress(instance_module, bridge_id)

@spec mark_ingress(module(), String.t()) :: :ok

Records successful inbound activity for a running bridge.

mark_outbound(instance_module, bridge_id)

@spec mark_outbound(module(), String.t()) :: :ok

Records successful outbound activity for a running bridge.

start_link(opts)

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

Starts a bridge runtime process for a configured bridge.

status(pid)

@spec status(pid()) :: {:ok, Jido.Messaging.BridgeStatus.t()}

Returns a status snapshot for the bridge process.

whereis(instance_module, bridge_id)

@spec whereis(module(), String.t()) :: pid() | nil

Returns the running bridge process for bridge_id, if one is registered.