Skip to content

Streaming

Home > The Dockfile > Streaming

Dockrion supports two streaming patterns for delivering real-time events from your agent to callers:

PatternEndpointHow it works
A — Direct SSEPOST /invoke/streamCaller sends a payload, receives Server-Sent Events as the agent runs
B — Async RunsPOST /runsGET /runs/{id}/eventsCaller starts a run, polls or subscribes for events via a separate SSE endpoint

Both patterns are configured through the expose and streaming sections of the Dockfile.

The expose section controls the HTTP surface:

expose:
rest: true
streaming: sse # sse | websocket | none
port: 8080
host: 0.0.0.0
cors:
origins: ["*"]
methods: ["*"]
FieldTypeDefaultNotes
restbooltrueEnable REST endpoints (/invoke, /health, etc.)
streamingstr"sse""sse", "websocket", or "none". WebSocket is planned, not yet implemented.
portint8080Must be 1–65535
hoststr"0.0.0.0"Bind address
corsdictnullIf omitted, defaults to origins: ["*"], methods: ["*"]

Validation: At least one of rest or streaming must be enabled (the model validator rejects rest: false with streaming: none).

The streaming section controls async runs, backends, and event behavior:

streaming:
async_runs: true
backend: memory # memory | redis
allow_client_ids: true
events:
allowed: chat # preset or list
heartbeat_interval: 15
max_run_duration: 3600
connection:
default_timeout: 300
max_subscribers_per_run: 100
PageWhat it covers
SSE StreamingPattern A configuration, how /invoke/stream works
Async RunsPattern B configuration, /runs lifecycle
Event TypesAll event types, presets (minimal/chat/debug/all), custom events
BackendsMemory vs Redis backends
StreamContextEmitting events from your agent code

Source: ExposeConfig, StreamingConfig in packages/schema/dockrion_schema/dockfile_v1.py; dockrion_events package


Up: The Dockfile | Previous: 2.5 Secrets | Next: 2.7 Observability →