docs/Cli/Broadcast

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 patternBroadcast topicReceived?
metrics.*metrics.cpu
metrics.cpumetrics.cpu
metrics.*metrics.cpu.temp
*metrics.cpu