trigger.topic --topic TEXT → topicRuns every time kv.message.publish sends a message on --topic (the publisher's channel). It is the project's in-process pub/sub, for work that should happen after a request answered (send the mail, resize the image, recompute a total) without making the request wait. Answers one key, topic: { topic, message, node_id } — topic the --topic it listens on, message what was published (input.topic.message, $trigger.message). Messages are not stored: a subscriber that is not active when the publish happens never sees it.
Flags
--topic(required): The topic to listen on — the channelkv.message.publishsends on.
Examples
Do the slow part after the request
| trigger.topic --topic order.placedThe publisher: | kv.message.publish --topic order.placed --body "{{ { order_id: input.query.rows[0]._key, email: $trigger.body.email } }}".
It answers:
{ "topic": { "topic": "order.placed", "message": { "order_id": "o_91", "email": "[email protected]" }, "node_id": "n0" }}