Skip to content

Function: createBusInstance()

Makaio Framework


Makaio Framework / bus-core / createBusInstance

createBusInstance<Namespace>(options?): IMakaioBus<Namespace>

Defined in: ../../../packages/bus-core/src/bus.ts:459

Creates a new bus instance with optional context, namespace isolation, and transports.

The bus instance provides methods for type-safe event emission, request/response patterns, handler registration, and namespace management. Handlers use SubjectDefinition objects (not strings) for full type safety and schema validation.

Namespace extends string | undefined = undefined

CreateBusOptions<Namespace>

Optional creation options. context defaults to a fresh createBusContext(). namespace scopes the instance (e.g. 'adapter:claudeCode'). transports are registered immediately after creation.

IMakaioBus<Namespace>

A new IMakaioBus instance with methods for on, emit, request, scoped, and schema management