Jido.Messaging.Demo.Bridge (Jido Messaging v1.0.0)

Copy Markdown View Source

Bridges messages between Telegram and Discord via Signal Bus subscription.

Subscribes to jido.messaging.room.message_added signals and forwards to external platforms, skipping the origin platform to prevent loops.

Architecture

Instead of being called directly by channel handlers, the Bridge now:

  1. Subscribes to the Signal Bus for message_added events
  2. Receives signals when any message is added to any room
  3. Forwards to all bound platforms except the origin

This decouples the Bridge from channel handlers and makes it event-driven.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

binding()

@type binding() :: {:telegram | :discord, module(), String.t(), String.t()}

t()

@type t() :: %Jido.Messaging.Demo.Bridge{
  bindings: [any()],
  instance_module: module(),
  room_id: nil | nil | binary(),
  subscribed: boolean()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)