Interfaces · @purista/core
EventBridge
Event transport adapter contract used by PURISTA services.
Signature
interface EventBridge Properties
4 entries
capabilities
Property
capabilities: EventBridgeCapabilities Runtime capability matrix used for strict startup validation.
defaultCommandTimeout
Property
defaultCommandTimeout: number The default time until when a command invocation automatically returns a time out error
instanceId
Property
instanceId: string Stable runtime instance id used to distinguish bridge processes.
name
Property
name: string Human-readable bridge name used in logs, traces, and metrics.
Methods
17 entries
destroy
Method
destroy(): Promise<void> Shut down event bridge as gracefully as possible
emitMessage
Method
emitMessage(message: Omit<EBMessage, "id" | "timestamp" | "correlationId">): Promise<Readonly<EBMessage>> Emit a message to the event bridge without awaiting a result.
getInFlightExecutionCount
Method
getInFlightExecutionCount(): number Number of currently running handlers across all work kinds.
getInFlightExecutionCounts
Method
getInFlightExecutionCounts(): InFlightExecutionCounts Number of currently running handlers grouped by work kind.
getPausedSubscriptionConsumers
Method
getPausedSubscriptionConsumers(): PausedSubscriptionConsumersByRegistrationKey Returns paused subscription consumer states keyed by adapter registration key.
invoke
Method
invoke<T>(input: Omit<Command, "id" | "messageType" | "timestamp" | "correlationId">, ttl?: number): Promise<T> Call a command of a service and return the result of this command
isHealthy
Method
isHealthy(): Promise<boolean> Indicates if the eventbridge is running and works correctly
isReady
Method
isReady(): Promise<boolean> Indicates if the eventbridge has been started and is connected to underlaying message broker
openStream
Method
openStream<Chunk, Final>(input: Omit<StreamOpenRequest, "id" | "messageType" | "timestamp" | "correlationId">, ttl?: number): Promise<StreamHandle<Chunk, Final>> Open a stream invocation.
registerCommand
Method
registerCommand(address: EBMessageAddress, cb: (message: { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: Command; ... }) => Promise<Readonly<Omit<unknown, unknown>> | Readonly<Omit<unknown, unknown>>>, metadata: CommandDefinitionMetadataBase, eventBridgeConfig: DefinitionEventBridgeConfig): Promise<string> Register a command handler for a service target.
registerStream
Method
registerStream(address: EBMessageAddress, cb: (message: StreamMessage) => Promise<void>, metadata: StreamDefinitionMetadataBase, eventBridgeConfig: DefinitionEventBridgeConfig): Promise<string> Register a service stream handler for a service target.
registerSubscription
Method
registerSubscription(subscription: Subscription, cb: (message: EBMessage) => Promise<Omit<{ contentEncoding: unknown; contentType: unknown; correlationId: unknown; eventName: unknown; id: unknown; messageType: unknown; ... }, unknown | unknown> | undefined>): Promise<string> Register a new subscription.
resumeSubscriptionConsumer
Method
resumeSubscriptionConsumer(registrationKey: string): Promise<void> Resumes a paused subscription consumer by registration key.
start
Method
start(): Promise<void> Start the eventbridge and connect to the underlaying message broker
unregisterCommand
Method
unregisterCommand(address: EBMessageAddress): Promise<void> Unregister a service command
unregisterStream
Method
unregisterStream(address: EBMessageAddress): Promise<void> Unregister a service stream
unregisterSubscription
Method
unregisterSubscription(address: EBMessageAddress): Promise<void> Unregister a subscription.