Skip to content

Topic Suffixes

cross.stream uses special topic suffixes to coordinate between components and track their lifecycle. This reference documents all suffixes, organized by component type.

Generators

SuffixDescriptionEmitted By
.spawnCreate or update a generatorUser
.terminateStop a generatorUser
.sendInput to duplex generatorsUser
.runningGenerator has startedSystem
.stoppedGenerator pipeline stoppedSystem
.shutdownGenerator loop fully exitedSystem
.parse.errorScript parsing failedSystem
.recvOutput from generatorSystem

Handlers

SuffixDescriptionEmitted By
.registerRegister a handlerUser
.unregisterUnregister a handlerUser
.activeHandler is now activeSystem
.unregisteredHandler has been removedSystem
.outOutput from handlerSystem

Commands

SuffixDescriptionEmitted By
.defineDefine a commandUser
.callInvoke a commandUser
.readyCommand ready for callsSystem
.errorCommand execution failedSystem
.responseCommand execution resultSystem

System Topics

System topics manage cross.stream’s internal operations and lifecycle:

TopicDescriptionContext
xs.startSystem initialization completeDefault
xs.contextNew context createdDefault
xs.thresholdStream processing threshold markerPer-context
xs.pulseSynthetic pulse events (configurable interval)Per-context

Customizable Suffixes

The following output suffixes can be customized using return_options:

  • .recv (Generators) - Can be changed via return_options.suffix
  • .out (Handlers) - Can be changed via return_options.suffix
  • .response (Commands) - Can be changed via return_options.suffix

Example customization:

Terminal window
{
run: {|| "Hello, World!" },
return_options: {
suffix: ".message" # Changes .recv to .message
}
}

Metadata

All lifecycle and output events include relevant metadata:

  • source_id / handler_id / command_id: ID of the component instance
  • frame_id: ID of the triggering frame (for handlers/commands)
  • Error events include error field with error details
  • Stopped events include reason field explaining why the component stopped