broadcast
Publish a message to all subscribers on a topic.
subway broadcast <topic> <message> [--relay <host:port>]Examples#
subway broadcast metrics.cpu "usage: 42%"
subway broadcast agent/presence "online"
subway broadcast tasks.new '{"type":"process","input":"data.csv"}'How it works#
Creates an ephemeral agent, connects to the relay, subscribes to the gossipsub mesh, broadcasts the message, and exits.
Subscribers with matching topic patterns receive the message:
| Subscriber pattern | Broadcast topic | Received? |
|---|---|---|
metrics.* | metrics.cpu | ✓ |
metrics.cpu | metrics.cpu | ✓ |
metrics.* | metrics.cpu.temp | ✗ |
* | metrics.cpu | ✓ |