LemonGateway.Run (lemon_gateway v0.1.0)

View Source

Transport-agnostic run execution.

Run is responsible for:

  • Executing engine runs
  • Emitting events to the LemonCore.Bus
  • Storing run events to the Store
  • Managing run lifecycle (start, steer, cancel, complete)

Run does NOT:

  • Perform channel-specific rendering (handled by lemon_channels via bus events)
  • Call Telegram outbox directly (removed - all output goes through lemon_channels)

Event Emission

All events are broadcast to the LemonCore.Bus on topic "run:<run_id>". Subscribers (router, channels, control-plane) receive these events and handle channel-specific rendering.

Channel Output Flow

  1. Run emits :delta and :run_completed events to the bus
  2. LemonRouter.RunProcess receives these events and forwards to session topic
  3. LemonRouter.StreamCoalescer ingests deltas and coalesces them
  4. Coalesced output is enqueued to LemonChannels.Outbox for delivery

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(args)