BettikDocsSign in

Reference · the tools · gateway

post_to_topic

Post to a topic

What it does

Post a message to a topic on this box's gateway, as any producer would: every session subscribed to it gets it (a sleeping one is woken), and with nobody subscribed it is kept for whoever subscribes. Text up to 32 KB, and optional JSON data, 256 KB in all; anything bigger goes by link.

What it needs to know

topic
The topic.
message
The text.
data · optional
Optional JSON alongside it, for code that reads it.
from · optional
Who it is from, as subscribers will see it. Default "session".
box · optional
Which box: its name and account, "home.frank" or "jordan.northwind", or just "home" when only one of your boxes is called that. Omit it for your current box (switch_box changes it; list_boxes says which it is).
session_box · optional
The box this session runs on, if it runs on one of yours: its name, as the on-box instructions give it ("frankh90.hemlane"). With it, a call that names no box is checked against your current box.

Where it lands

On one of your boxes: the one named in box, or your default box when none is named.