lt.controlplane
lt.controlplane works with the HotMesh control plane: namespace discovery, worker roll call, throttling and stream statistics. Methods that take an app id default to durable when it is omitted. See Observability.
listApps
Section titled “listApps”const result = await lt.controlplane.listApps();List every registered application namespace.
Parameters: none.
Returns: LTApiResult<{ apps: string[] }>
Auth: Not required.
rollCall
Section titled “rollCall”const result = await lt.controlplane.rollCall({ appId: 'durable', delay: 2000 });Query active worker profiles for a namespace. Sends a roll call to the mesh and collects responses within the delay window.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
appId |
string |
No | Namespace to query (default durable) |
delay |
number |
No | Milliseconds to wait for worker responses |
Returns: LTApiResult<{ profiles: object[] }>
Auth: Not required.
throttle
Section titled “throttle”const result = await lt.controlplane.throttle({ throttle: 50, topic: 'my-topic' });Apply a throttle to workflow execution. Also publishes a mesh.throttle event to the dashboard event stream.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
throttle |
number |
Yes | Throttle value to apply |
appId |
string |
No | Namespace (default durable) |
topic |
string |
No | Topic to scope the throttle to |
guid |
string |
No | GUID to scope the throttle to |
scope |
'engines' | 'workers' | 'all' |
No | Which mesh members the throttle applies to |
Returns: LTApiResult<{ success: boolean }>. 400 when throttle is not a number.
Auth: Not required.
getStreamStats
Section titled “getStreamStats”const result = await lt.controlplane.getStreamStats({ app_id: 'durable', duration: '30m' });Read stream statistics (throughput, backlog) for a namespace over a time window.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
app_id |
string |
No | Namespace (default durable) |
duration |
string |
No | Aggregation window, for example '1h' or '30m' (default '1h') |
stream |
string |
No | One stream name to filter by |
Returns: LTApiResult<StreamStats>
Auth: Not required.
listStreamMessages
Section titled “listStreamMessages”const result = await lt.controlplane.listStreamMessages({ namespace: 'durable', source: 'worker', limit: 25, offset: 0, sort_by: 'created_at', order: 'desc', status: 'pending',});Browse messages from one stream table. Engine and worker streams are separate tables with different schemas, so both namespace and source are required.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
namespace |
string |
Yes | Postgres schema (namespace) |
source |
string |
Yes | engine or worker |
limit |
number |
No | Page size, 1 to 100 (default 25) |
offset |
number |
No | Pagination offset (default 0) |
sort_by |
string |
No | created_at, stream_name, priority or id |
order |
string |
No | asc or desc (default desc) |
status |
string |
No | pending, claimed, processed or dead_lettered |
stream_name |
string |
No | Partial match on stream name |
msg_type |
string |
No | Message type (worker streams only) |
Returns: LTApiResult<{ messages: StreamMessage[], total: number }>
Auth: Not required.
subscribe
Section titled “subscribe”const result = await lt.controlplane.subscribe({ appId: 'durable' });Subscribe to mesh events for a namespace so they are captured and forwarded.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
appId |
string |
No | Namespace to subscribe to (default durable) |
Returns: LTApiResult<{ subscribed: true, appId: string }>
Auth: Not required.
