ExecutionLogsChannel
Specialized channel for execution log subscriptions Provides a cleaner API than the generic RealtimeChannel
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ExecutionLogsChannel(
url,executionId,type,token,tokenRefreshCallback):ExecutionLogsChannel
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url |
string |
executionId |
string |
type |
ExecutionType |
token |
string | null |
tokenRefreshCallback |
(() => Promise<string | null>) | null |
Returns
Section titled “Returns”ExecutionLogsChannel
Methods
Section titled “Methods”onLog()
Section titled “onLog()”onLog(
callback):this
Register a callback for log events
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
callback |
ExecutionLogCallback |
Function to call when log entries are received |
Returns
Section titled “Returns”this
This channel for chaining
Example
Section titled “Example”channel.onLog((log) => { console.log(`[${log.level}] Line ${log.line_number}: ${log.message}`)})subscribe()
Section titled “subscribe()”subscribe(
callback?):this
Subscribe to execution logs
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
callback? |
(status, err?) => void |
Optional status callback |
Returns
Section titled “Returns”this
Promise that resolves when subscribed
Example
Section titled “Example”await channel.subscribe()unsubscribe()
Section titled “unsubscribe()”unsubscribe():
Promise<"error"|"ok"|"timed out">
Unsubscribe from execution logs
Returns
Section titled “Returns”Promise<"error" | "ok" | "timed out">
Promise resolving to status
Example
Section titled “Example”await channel.unsubscribe()