stream
stream
¶
Server-Sent Events (SSE) streaming API endpoints.
Job status streams use the DaemonEventBridge when a conductor is
available (real-time via daemon.monitor.stream), falling back to
state-backend polling otherwise.
Classes¶
LogDownloadInfo
¶
Bases: BaseModel
Information about log file for download.
Functions¶
stream_job_status
async
¶
stream_job_status(job_id, poll_interval=2.0, backend=Depends(get_state_backend))
Stream real-time job status updates via Server-Sent Events.
Uses the conductor event bridge for real-time updates when available, falling back to state-backend polling otherwise.
Source code in src/marianne/dashboard/routes/stream.py
stream_logs
async
¶
stream_logs(job_id, follow=True, tail_lines=DEFAULT_TAIL_LINES, backend=Depends(get_state_backend))
Stream job logs via Server-Sent Events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
str
|
Job identifier |
required |
follow
|
bool
|
If true, tail the log file for new content |
True
|
tail_lines
|
int
|
Number of recent lines to send initially (max MAX_TAIL_LINES) |
DEFAULT_TAIL_LINES
|
backend
|
StateBackend
|
State backend (injected) |
Depends(get_state_backend)
|
Returns:
| Type | Description |
|---|---|
StreamingResponse
|
SSE stream of log lines |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 if job/logs not found, 400 if invalid parameters |
Source code in src/marianne/dashboard/routes/stream.py
download_logs
async
¶
download_logs(job_id, backend=Depends(get_state_backend))
Download complete log file as plain text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
str
|
Job identifier |
required |
backend
|
StateBackend
|
State backend (injected) |
Depends(get_state_backend)
|
Returns:
| Type | Description |
|---|---|
Response
|
Complete log file content as text/plain |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 if job/logs not found |
Source code in src/marianne/dashboard/routes/stream.py
get_log_info
async
¶
get_log_info(job_id, backend=Depends(get_state_backend))
Get information about job log file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
str
|
Job identifier |
required |
backend
|
StateBackend
|
State backend (injected) |
Depends(get_state_backend)
|
Returns:
| Type | Description |
|---|---|
LogDownloadInfo
|
Log file information |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 if job/logs not found |