Skip to content

Interface: BusSubscribeMessage

Makaio Framework


Makaio Framework / bus-core / BusSubscribeMessage

Defined in: ../../../packages/bus-core/src/types/transports.ts:28

Subscribe message for client subscription management.

Supports both subject-based filtering (wildcards) and payload-based filtering (declarative filter specs). Both are applied server-side for smart-routing.

Priority arrays enable cross-transport priority-based dispatch: the receiver uses the arrays to populate its remote handler registry so that dispatch can consider handler priorities across process boundaries.

// Request handler with priorities
{ type: 'subscribe', subjects: { 'ui.navigate': [100, 200] } }
// Event-only handler (no priority-based dispatch)
{ type: 'subscribe', subjects: { 'session.created': [] } }

optional filters?: Record<string, PayloadFilter>

Defined in: ../../../packages/bus-core/src/types/transports.ts:51

Optional payload filters per subject. Key is the subject pattern, value is the filter to apply. Messages are only forwarded if payload matches the filter.

{
subjects: { 'mcp.event': [] },
filters: {
'mcp.event': { agentId: 'agent-123' }
}
}

subjects: Record<string, number[]>

Defined in: ../../../packages/bus-core/src/types/transports.ts:36

Subjects and their handler priorities. Keys are subject patterns (can include wildcards like 'adapter.*'). Values are arrays of handler priorities registered for that subject. An empty array indicates event-only handlers with no priority-based dispatch.


type: "subscribe"

Defined in: ../../../packages/bus-core/src/types/transports.ts:29