@orditjs/runtime
v0.2.1-beta.5
Published
Runtime interno y engine de orquestacion reutilizable para interpretar outcomes y encapsular correlacion, retries y estado.
Readme
@orditjs/runtime
Lower-level runtime primitives for workflow-style orchestration.
Use this package when you need the existing ProcessManager engine, workflow
ports, handler registry and result validation. The main ordit framework is
handler-centric; this package is the reusable runtime layer for stateful
processes, correlation, outbox dispatch and compatibility scenarios.
Install
npm install @orditjs/runtime @orditjs/contractsWhat is inside
ProcessManager: coordinates workflow message handling.HandlerRegistry: resolves handlers from process definitions and state.HandlerResultValidator: validates workflow actions.- Ports for state, inbox, correlation, outbox, dispatch and observers.
- Errors for missing handlers, invalid results and correlation failures.
Basic shape
import { ProcessManager } from '@orditjs/runtime'
const manager = new ProcessManager({
definitions: [definition],
stateStore,
inboxStore,
correlationStore,
outboxStore,
dispatcher,
observer,
})
await manager.handle(envelope)Required ports
IProcessStateStore: load and save process state.IInboxStore: detect and mark processed messages.ICorrelationStore: bind and resolve correlation keys.IOutboxStore: stage and drain outgoing envelopes.IDispatcher: dispatch outgoing envelopes.IWorkflowObserver: optional logs, metrics and traces.
Creating handler results
Workflow handlers usually use helpers from @orditjs/contracts:
import { ProcessActionFactory, createHandlerResult } from '@orditjs/contracts'
const actions = new ProcessActionFactory()
const result = createHandlerResult(
[
actions.transitionTo('waiting-reply'),
actions.waitFor('reply.received', 'corr-1'),
],
{
step: 'waiting-reply',
}
)Testing
For in-memory adapters and a ready harness, use the internal test support
package @orditjs/testing in this monorepo. Published applications should
provide their own adapters or use framework-level tooling when available.
Package boundary
@orditjs/runtime is not the high-level public framework and does not perform
project discovery or handler loading. It is a low-level orchestration engine for
advanced integrations and compatibility.
