# `BB.Jido.PubSubBridge`
[🔗](https://github.com/beam-bots/bb_jido/blob/main/lib/bb/jido/pub_sub_bridge.ex#L5)

GenServer that bridges `BB.PubSub` messages into a Jido agent as signals.

Subscribes to configured BB topics on behalf of a Jido agent process and
forwards each `{:bb, source_path, %BB.Message{}}` delivery as a
`Jido.Signal` via `Jido.AgentServer.cast/2`.

## Options

- `:robot` — robot module to subscribe against (required).
- `:agent` — pid or registered name of the Jido agent server that should
  receive the forwarded signals (required).
- `:topics` — list of paths to subscribe to (default `[[:state_machine]]`).
  Each path is a list of atoms as accepted by `BB.PubSub.subscribe/3`.
- `:message_types` — list of payload modules to filter on at subscription
  time (default `[]`, meaning no filter). Applied to every topic.
- `:throttle_ms` — optional minimum interval between signals of the same
  type. Repeated signals arriving within the window are dropped. Defaults
  to no throttling.

## Filtering

Topic and message-type filtering happen at the PubSub layer (cheap). The
bridge additionally enforces an optional per-type throttle to limit signal
volume for high-frequency topics (e.g. joint states at 100Hz).

# `option`

```elixir
@type option() ::
  {:robot, module()}
  | {:agent, GenServer.server()}
  | {:topics, [[atom()]]}
  | {:message_types, [module()]}
  | {:throttle_ms, pos_integer()}
  | GenServer.option()
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link([option()]) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
