abxbus 2.5.1 → 2.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CoreClient.d.ts +167 -0
- package/dist/cjs/CoreEventBus.d.ts +334 -0
- package/dist/cjs/base_event.d.ts +211 -0
- package/dist/cjs/bridge_jsonl.d.ts +26 -0
- package/dist/cjs/bridge_nats.d.ts +20 -0
- package/dist/cjs/bridge_postgres.d.ts +31 -0
- package/dist/cjs/bridge_redis.d.ts +34 -0
- package/dist/cjs/bridge_sqlite.d.ts +30 -0
- package/dist/cjs/event_bus.d.ts +125 -0
- package/dist/cjs/event_handler.d.ts +139 -0
- package/dist/cjs/event_history.d.ts +45 -0
- package/dist/cjs/event_result.d.ts +86 -0
- package/dist/cjs/lock_manager.d.ts +70 -0
- package/dist/cjs/retry.d.ts +8 -1
- package/dist/cjs/retry.js +283 -14
- package/dist/cjs/retry.js.map +2 -2
- package/dist/esm/retry.js +283 -14
- package/dist/esm/retry.js.map +2 -2
- package/dist/types/CoreClient.d.ts +167 -0
- package/dist/types/CoreEventBus.d.ts +334 -0
- package/dist/types/base_event.d.ts +211 -0
- package/dist/types/bridge_jsonl.d.ts +26 -0
- package/dist/types/bridge_nats.d.ts +20 -0
- package/dist/types/bridge_postgres.d.ts +31 -0
- package/dist/types/bridge_redis.d.ts +34 -0
- package/dist/types/bridge_sqlite.d.ts +30 -0
- package/dist/types/event_bus.d.ts +125 -0
- package/dist/types/event_handler.d.ts +139 -0
- package/dist/types/event_history.d.ts +45 -0
- package/dist/types/event_result.d.ts +86 -0
- package/dist/types/lock_manager.d.ts +70 -0
- package/dist/types/retry.d.ts +8 -1
- package/package.json +1 -1
- package/src/retry.ts +368 -22
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { RustCoreClient, type CoreMessage } from './CoreClient.js';
|
|
2
|
+
import { BaseEvent } from './BaseEvent.js';
|
|
3
|
+
import type { BaseEventJSON } from './BaseEvent.js';
|
|
4
|
+
import { EventHandler } from './EventHandler.js';
|
|
5
|
+
import type { EventHandlerJSON } from './EventHandler.js';
|
|
6
|
+
import { EventResult } from './EventResult.js';
|
|
7
|
+
import { AsyncLock, HandlerLock, type EventConcurrencyMode, type EventHandlerCompletionMode, type EventHandlerConcurrencyMode } from './LockManager.js';
|
|
8
|
+
import type { EventBusMiddlewareInput } from './EventBusMiddleware.js';
|
|
9
|
+
import { type EventHandlerCallable, type EventPattern, type FilterOptions, type FindOptions } from './types.js';
|
|
10
|
+
export type CoreHandler<T extends BaseEvent = BaseEvent> = EventHandlerCallable<T>;
|
|
11
|
+
export type RustCoreEventBusOptions = {
|
|
12
|
+
id?: string;
|
|
13
|
+
core?: RustCoreClient;
|
|
14
|
+
event_concurrency?: EventConcurrencyMode;
|
|
15
|
+
event_handler_concurrency?: EventHandlerConcurrencyMode;
|
|
16
|
+
event_handler_completion?: EventHandlerCompletionMode;
|
|
17
|
+
event_handler_detect_file_paths?: boolean;
|
|
18
|
+
event_timeout?: number | null;
|
|
19
|
+
event_slow_timeout?: number | null;
|
|
20
|
+
event_handler_timeout?: number | null;
|
|
21
|
+
event_handler_slow_timeout?: number | null;
|
|
22
|
+
max_history_size?: number | null;
|
|
23
|
+
max_history_drop?: boolean;
|
|
24
|
+
middlewares?: EventBusMiddlewareInput[];
|
|
25
|
+
background_worker?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type RustCoreHandlerOptions = {
|
|
28
|
+
id?: string;
|
|
29
|
+
handler_name?: string;
|
|
30
|
+
handler_registered_at?: string;
|
|
31
|
+
handler_file_path?: string | null;
|
|
32
|
+
handler_timeout?: number | null;
|
|
33
|
+
handler_slow_timeout?: number | null;
|
|
34
|
+
handler_concurrency?: EventHandlerConcurrencyMode | null;
|
|
35
|
+
handler_completion?: EventHandlerCompletionMode | null;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
export type RustCoreFilterOptions = {
|
|
39
|
+
limit?: number | null;
|
|
40
|
+
[field: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
export type RustCoreEventBusJSON = {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
max_history_size: number | null;
|
|
46
|
+
max_history_drop: boolean;
|
|
47
|
+
event_concurrency: EventConcurrencyMode;
|
|
48
|
+
event_timeout: number | null;
|
|
49
|
+
event_slow_timeout: number | null;
|
|
50
|
+
event_handler_concurrency: EventHandlerConcurrencyMode;
|
|
51
|
+
event_handler_completion: EventHandlerCompletionMode;
|
|
52
|
+
event_handler_timeout: number | null;
|
|
53
|
+
event_handler_slow_timeout: number | null;
|
|
54
|
+
event_handler_detect_file_paths: boolean;
|
|
55
|
+
handlers: Record<string, EventHandlerJSON>;
|
|
56
|
+
handlers_by_key: Record<string, string[]>;
|
|
57
|
+
event_history: Record<string, BaseEventJSON>;
|
|
58
|
+
pending_event_queue: string[];
|
|
59
|
+
};
|
|
60
|
+
export declare class CoreEventBusRegistry {
|
|
61
|
+
private _bus_refs;
|
|
62
|
+
private _bus_refs_by_id;
|
|
63
|
+
add(bus: RustCoreEventBus): void;
|
|
64
|
+
discard(bus: RustCoreEventBus): void;
|
|
65
|
+
has(bus: RustCoreEventBus): boolean;
|
|
66
|
+
get size(): number;
|
|
67
|
+
[Symbol.iterator](): IterableIterator<RustCoreEventBus>;
|
|
68
|
+
findBusById(bus_id: string): RustCoreEventBus | undefined;
|
|
69
|
+
findEventById(event_id: string): BaseEvent | null;
|
|
70
|
+
}
|
|
71
|
+
export declare const rustCoreEventBusRegistry: CoreEventBusRegistry;
|
|
72
|
+
export declare class CoreEventHistory implements Iterable<[string, BaseEvent]> {
|
|
73
|
+
max_history_size: number | null;
|
|
74
|
+
max_history_drop: boolean;
|
|
75
|
+
private readonly bus;
|
|
76
|
+
constructor(bus: RustCoreEventBus, options?: {
|
|
77
|
+
max_history_size?: number | null;
|
|
78
|
+
max_history_drop?: boolean;
|
|
79
|
+
});
|
|
80
|
+
get size(): number;
|
|
81
|
+
[Symbol.iterator](): Iterator<[string, BaseEvent]>;
|
|
82
|
+
entries(): IterableIterator<[string, BaseEvent]>;
|
|
83
|
+
keys(): IterableIterator<string>;
|
|
84
|
+
values(): IterableIterator<BaseEvent>;
|
|
85
|
+
clear(): void;
|
|
86
|
+
get(event_id: string): BaseEvent | undefined;
|
|
87
|
+
set(event_id: string, event: BaseEvent): this;
|
|
88
|
+
has(event_id: string): boolean;
|
|
89
|
+
delete(event_id: string): boolean;
|
|
90
|
+
addEvent(event: BaseEvent): void;
|
|
91
|
+
getEvent(event_id: string): BaseEvent | undefined;
|
|
92
|
+
removeEvent(event_id: string): boolean;
|
|
93
|
+
hasEvent(event_id: string): boolean;
|
|
94
|
+
find(event_pattern: '*', options?: FindOptions<BaseEvent>): Promise<BaseEvent | null>;
|
|
95
|
+
find(event_pattern: '*', where: (event: BaseEvent) => boolean, options?: FindOptions<BaseEvent>): Promise<BaseEvent | null>;
|
|
96
|
+
find<T extends BaseEvent>(event_pattern: EventPattern<T>, options?: FindOptions<T>): Promise<T | null>;
|
|
97
|
+
find<T extends BaseEvent>(event_pattern: EventPattern<T>, where: (event: T) => boolean, options?: FindOptions<T>): Promise<T | null>;
|
|
98
|
+
filter(event_pattern: '*', options?: FilterOptions<BaseEvent>): Promise<BaseEvent[]>;
|
|
99
|
+
filter(event_pattern: '*', where: (event: BaseEvent) => boolean, options?: FilterOptions<BaseEvent>): Promise<BaseEvent[]>;
|
|
100
|
+
filter<T extends BaseEvent>(event_pattern: EventPattern<T>, options?: FilterOptions<T>): Promise<T[]>;
|
|
101
|
+
filter<T extends BaseEvent>(event_pattern: EventPattern<T>, where: (event: T) => boolean, options?: FilterOptions<T>): Promise<T[]>;
|
|
102
|
+
}
|
|
103
|
+
export declare class CoreLockFacade {
|
|
104
|
+
private readonly bus;
|
|
105
|
+
private paused_count;
|
|
106
|
+
private pause_waiters;
|
|
107
|
+
private active_handler_results;
|
|
108
|
+
readonly bus_event_lock: AsyncLock;
|
|
109
|
+
constructor(bus: RustCoreEventBus);
|
|
110
|
+
_getActiveHandlerResultForCurrentAsyncContext(): EventResult | undefined;
|
|
111
|
+
_getActiveHandlerResults(): EventResult[];
|
|
112
|
+
_requestRunloopPause(): () => void;
|
|
113
|
+
_waitUntilRunloopResumed(): Promise<void>;
|
|
114
|
+
_isPaused(): boolean;
|
|
115
|
+
_notifyIdleListeners(): void;
|
|
116
|
+
_isAnyHandlerActive(): boolean;
|
|
117
|
+
getLockForEvent(event: BaseEvent): AsyncLock | null;
|
|
118
|
+
waitForIdle(timeout?: number | null): Promise<boolean>;
|
|
119
|
+
_runWithHandlerLock<T>(event: BaseEvent, default_concurrency: EventHandlerConcurrencyMode, fn: (handler_lock: HandlerLock | null) => Promise<T> | T): Promise<T>;
|
|
120
|
+
_runWithHandlerDispatchContext<T>(result: EventResult, fn: () => Promise<T> | T): Promise<T>;
|
|
121
|
+
_runWithEventLock<T>(event: BaseEvent, fn: () => Promise<T> | T, options?: {
|
|
122
|
+
bypass_event_locks?: boolean;
|
|
123
|
+
pre_acquired_lock?: AsyncLock | null;
|
|
124
|
+
}): Promise<T>;
|
|
125
|
+
clear(): void;
|
|
126
|
+
}
|
|
127
|
+
export declare class RustCoreEventBus {
|
|
128
|
+
readonly core: RustCoreClient;
|
|
129
|
+
readonly name: string;
|
|
130
|
+
readonly id: string;
|
|
131
|
+
readonly bus_id: string;
|
|
132
|
+
readonly label: string;
|
|
133
|
+
readonly event_concurrency: EventConcurrencyMode;
|
|
134
|
+
readonly event_handler_concurrency: EventHandlerConcurrencyMode;
|
|
135
|
+
readonly event_handler_completion: EventHandlerCompletionMode;
|
|
136
|
+
readonly event_handler_detect_file_paths: boolean;
|
|
137
|
+
readonly event_timeout: number | null;
|
|
138
|
+
readonly event_slow_timeout: number | null;
|
|
139
|
+
readonly event_handler_timeout: number | null;
|
|
140
|
+
readonly event_handler_slow_timeout: number | null;
|
|
141
|
+
readonly handlers: Map<string, EventHandler>;
|
|
142
|
+
readonly handlers_by_key: Map<string, string[]>;
|
|
143
|
+
readonly event_history: CoreEventHistory;
|
|
144
|
+
readonly locks: CoreLockFacade;
|
|
145
|
+
all_instances: CoreEventBusRegistry;
|
|
146
|
+
_lock_for_event_global_serial: AsyncLock;
|
|
147
|
+
in_flight_event_ids: Set<string>;
|
|
148
|
+
runloop_running: boolean;
|
|
149
|
+
private registered;
|
|
150
|
+
private events;
|
|
151
|
+
private processing;
|
|
152
|
+
private processing_tasks;
|
|
153
|
+
private middlewares;
|
|
154
|
+
private invocation_by_result_id;
|
|
155
|
+
private abort_by_invocation_id;
|
|
156
|
+
private event_types_by_pattern;
|
|
157
|
+
private event_timeout_causes;
|
|
158
|
+
private event_completion_waiters;
|
|
159
|
+
private event_emission_waiters;
|
|
160
|
+
private invocation_worker;
|
|
161
|
+
private background_worker_enabled;
|
|
162
|
+
private foreground_drain_task;
|
|
163
|
+
private foreground_drain_requested;
|
|
164
|
+
private serial_route_pause_releases;
|
|
165
|
+
private completed_event_refs;
|
|
166
|
+
private closed;
|
|
167
|
+
private readonly owns_shared_core;
|
|
168
|
+
private registered_max_history_size;
|
|
169
|
+
private registered_max_history_drop;
|
|
170
|
+
constructor(name?: string, options?: RustCoreEventBusOptions);
|
|
171
|
+
get pending_event_queue(): BaseEvent[];
|
|
172
|
+
get find_waiters(): Set<(event: BaseEvent) => void>;
|
|
173
|
+
set pending_event_queue(events: BaseEvent[]);
|
|
174
|
+
toString(): string;
|
|
175
|
+
defaultsRecord(): Record<string, unknown>;
|
|
176
|
+
private busRecord;
|
|
177
|
+
start(): void;
|
|
178
|
+
private syncBusHistoryPolicy;
|
|
179
|
+
on<T extends BaseEvent>(event_type: EventPattern<T>, handler: CoreHandler<T>, options?: RustCoreHandlerOptions): EventHandler;
|
|
180
|
+
on(event_type: '*', handler: CoreHandler, options?: RustCoreHandlerOptions): EventHandler;
|
|
181
|
+
off<T extends BaseEvent>(event_type: EventPattern<T> | '*', handler?: CoreHandler<T> | string | EventHandler): void;
|
|
182
|
+
emit<T extends BaseEvent>(event: T): T;
|
|
183
|
+
emit(event: Record<string, unknown>): Promise<CoreMessage>;
|
|
184
|
+
private scheduleForegroundDrain;
|
|
185
|
+
_onRunloopResumed(): void;
|
|
186
|
+
private drainForegroundCore;
|
|
187
|
+
private processAvailableCoreMessages;
|
|
188
|
+
private coreEventRecordForEmit;
|
|
189
|
+
private coreForwardControlOptions;
|
|
190
|
+
dispatch<T extends BaseEvent>(event: T): T;
|
|
191
|
+
onEventChange(_event: BaseEvent, _status: 'pending' | 'started' | 'completed'): Promise<void>;
|
|
192
|
+
onEventResultChange(_event: BaseEvent, _result: EventResult, _status: 'pending' | 'started' | 'completed'): Promise<void>;
|
|
193
|
+
hasMiddlewareHooks(): boolean;
|
|
194
|
+
hasEventChangeHooks(): boolean;
|
|
195
|
+
hasEventResultHooks(): boolean;
|
|
196
|
+
_notifyEventChange(event: BaseEvent, status: 'pending' | 'started' | 'completed'): void;
|
|
197
|
+
_notifyEventResultChange(event: BaseEvent, result: EventResult, status: 'pending' | 'started' | 'completed'): void;
|
|
198
|
+
findEventById(event_id: string): BaseEvent | null;
|
|
199
|
+
findLocalEventById(event_id: string): BaseEvent | undefined;
|
|
200
|
+
rememberEvent(event_id: string, event: BaseEvent): void;
|
|
201
|
+
rememberLiveEvent(event_id: string, event: BaseEvent): void;
|
|
202
|
+
forgetEvent(event_id: string): void;
|
|
203
|
+
localEvents(): IterableIterator<BaseEvent>;
|
|
204
|
+
importEventsToCore(events: BaseEvent[], pending_events?: BaseEvent[]): void;
|
|
205
|
+
historyRecords(event_pattern?: string, limit?: number | null): Record<string, unknown>[];
|
|
206
|
+
historyEventIds(event_pattern?: string, limit?: number | null, statuses?: string[] | null): string[];
|
|
207
|
+
coreRecordBelongsToThisBus(record: Record<string, unknown>): boolean;
|
|
208
|
+
activeHandlerResult(): EventResult | null;
|
|
209
|
+
_getEventProxyScopedToThisBus<T extends BaseEvent>(event: T, _handler_result?: EventResult): T;
|
|
210
|
+
_hasProcessedEvent(event: BaseEvent): boolean;
|
|
211
|
+
_getHandlersForEvent(event: BaseEvent): EventHandler[];
|
|
212
|
+
private ensurePendingLocalResults;
|
|
213
|
+
_processEventImmediately<T extends BaseEvent>(event: T, _handler_result?: EventResult): Promise<T>;
|
|
214
|
+
private findActiveInvocationForQueueJump;
|
|
215
|
+
private waitForLocalCompletionPush;
|
|
216
|
+
private waitForLocalCompletionOrProcessingDrain;
|
|
217
|
+
_waitForEventCompletedInQueueOrder<T extends BaseEvent>(event: T): Promise<T>;
|
|
218
|
+
private eventIsOwnedByActiveHandler;
|
|
219
|
+
private findParentInvocationForEvent;
|
|
220
|
+
private findBusForInvocation;
|
|
221
|
+
processUntilEventCompleted(event_id: string, initial_messages?: CoreMessage[] | null): Promise<BaseEvent>;
|
|
222
|
+
private waitForCoreCompletedEvent;
|
|
223
|
+
runUntilEventCompleted(event_id: string): Promise<BaseEvent>;
|
|
224
|
+
_syncEventRuntimeOptions(event: BaseEvent): void;
|
|
225
|
+
waitUntilIdle(timeout?: number | null): Promise<boolean>;
|
|
226
|
+
isIdle(): boolean;
|
|
227
|
+
isIdleAndQueueEmpty(): boolean;
|
|
228
|
+
removeEventFromPendingQueue(_event: BaseEvent): number;
|
|
229
|
+
isEventInFlightOrQueued(event_id: string): boolean;
|
|
230
|
+
removeEventFromHistory(event_id: string): boolean;
|
|
231
|
+
destroy(options?: number | {
|
|
232
|
+
timeout?: number | null;
|
|
233
|
+
clear?: boolean;
|
|
234
|
+
}): Promise<void>;
|
|
235
|
+
eventIsChildOf(child_event: BaseEvent, parent_event: BaseEvent): boolean;
|
|
236
|
+
eventIsParentOf(parent_event: BaseEvent, child_event: BaseEvent): boolean;
|
|
237
|
+
logTree(): string;
|
|
238
|
+
private applyAndRunMessagesUntilEventCompleted;
|
|
239
|
+
private runInvocationMessagesInCoreRouteOrder;
|
|
240
|
+
private completedSnapshotOrEvent;
|
|
241
|
+
private releaseCompletedLocalEvent;
|
|
242
|
+
private trackLocalEventUntilCoreEvictsIt;
|
|
243
|
+
collectEvictedCompletedEventRefs(visible_event_ids?: Set<string> | null): void;
|
|
244
|
+
private pendingQueueEventsFromCore;
|
|
245
|
+
private refreshPendingQueueFromCore;
|
|
246
|
+
private refreshKnownEventsFromCore;
|
|
247
|
+
private applyCoreSnapshotToEvent;
|
|
248
|
+
find<T extends BaseEvent>(event_type: EventPattern<T> | '*', where_or_options?: ((event: T) => boolean) | FindOptions<T>, maybe_options?: FindOptions<T>): Promise<T | null>;
|
|
249
|
+
filter<T extends BaseEvent>(event_type: EventPattern<T> | '*', where_or_options?: ((event: T) => boolean) | FilterOptions<T>, maybe_options?: FilterOptions<T>): Promise<T[]>;
|
|
250
|
+
disconnect(): void;
|
|
251
|
+
close(): void;
|
|
252
|
+
stop(): void;
|
|
253
|
+
scheduleMicrotask(fn: () => void): void;
|
|
254
|
+
toJSON(): RustCoreEventBusJSON;
|
|
255
|
+
eventFromCoreRecord<T extends BaseEvent>(event_type: EventPattern<T> | '*', record: Record<string, unknown>): BaseEvent;
|
|
256
|
+
private isStaleInvocationOutcomeError;
|
|
257
|
+
private eventSnapshotMessageForInvocation;
|
|
258
|
+
private completeHandlerOrSnapshot;
|
|
259
|
+
private completeHandlerNoPatchesOrSnapshot;
|
|
260
|
+
private canUsePatchlessCompletedOutcome;
|
|
261
|
+
private errorHandlerOrSnapshot;
|
|
262
|
+
private activeCoreOutcomeBatch;
|
|
263
|
+
private runWithCoreOutcomeBatch;
|
|
264
|
+
private runWithoutCoreOutcomeBatch;
|
|
265
|
+
private localOutcomePatchMessages;
|
|
266
|
+
private commitInvocationOutcomeMessages;
|
|
267
|
+
private invocationCanUseBatchedOutcome;
|
|
268
|
+
private invocationUsesFirstCompletion;
|
|
269
|
+
private eventForInvocation;
|
|
270
|
+
private runInvocationOutcome;
|
|
271
|
+
private runInvocation;
|
|
272
|
+
private startForegroundCoreSignalTimer;
|
|
273
|
+
private applyExpiredEventTimeout;
|
|
274
|
+
private startForegroundEventTimeoutTimer;
|
|
275
|
+
private startedAtForInvocation;
|
|
276
|
+
private eventTimeoutForInvocation;
|
|
277
|
+
private startForegroundEventSlowWarningTimer;
|
|
278
|
+
private eventSlowTimeoutForInvocation;
|
|
279
|
+
private abortResultForEventTimeout;
|
|
280
|
+
private invocationAbortError;
|
|
281
|
+
private eventTimeoutIpcGraceSeconds;
|
|
282
|
+
private processAvailableAfterHandlerOutcome;
|
|
283
|
+
private releaseSerialRoutePausesForInvocation;
|
|
284
|
+
private applyResultSnapshot;
|
|
285
|
+
private retargetErrorResult;
|
|
286
|
+
private orderedResultRecords;
|
|
287
|
+
private childIdsFromResultRecord;
|
|
288
|
+
private attachResultChildren;
|
|
289
|
+
private normalizeResultError;
|
|
290
|
+
private restoreCoreError;
|
|
291
|
+
private restoreGenericError;
|
|
292
|
+
private publicCoreErrorMessage;
|
|
293
|
+
private causeForCancellation;
|
|
294
|
+
private parentTimeoutEventIdFromMessage;
|
|
295
|
+
private eventTimeoutCause;
|
|
296
|
+
private timeoutSecondsForCoreError;
|
|
297
|
+
private eventTimeoutSecondsForResult;
|
|
298
|
+
private resolveTimeoutOverride;
|
|
299
|
+
private positiveTimeoutFromUnknown;
|
|
300
|
+
private numberFromUnknown;
|
|
301
|
+
private timestampMs;
|
|
302
|
+
private timestampBefore;
|
|
303
|
+
private warnSlowEvent;
|
|
304
|
+
private warnSlowResult;
|
|
305
|
+
runWithActiveHandlerResult<T>(result: EventResult, fn: () => T): T;
|
|
306
|
+
private startWorker;
|
|
307
|
+
private stopWorker;
|
|
308
|
+
private handleWorkerMessages;
|
|
309
|
+
private runAndApplyInvocationMessages;
|
|
310
|
+
private runInvocationMessages;
|
|
311
|
+
private resolveEventCompletionWaiters;
|
|
312
|
+
private notifyEventEmissionWaiters;
|
|
313
|
+
private waitForLocalEventEmission;
|
|
314
|
+
private waitForEventCompleted;
|
|
315
|
+
private localBusesForCoreSession;
|
|
316
|
+
private busForInvocation;
|
|
317
|
+
private applyCoreMessageToLocalBuses;
|
|
318
|
+
private targetBusesForCoreMessage;
|
|
319
|
+
private applyCoreMessage;
|
|
320
|
+
private applyCoreMessageFromSharedCursor;
|
|
321
|
+
private patchBelongsToThisBus;
|
|
322
|
+
private localResultIdExists;
|
|
323
|
+
private applyCoreMessageUnchecked;
|
|
324
|
+
private applyResultRecord;
|
|
325
|
+
private cancelFirstModeLosersForCompletedEvent;
|
|
326
|
+
private _runMiddlewareHook;
|
|
327
|
+
private _onBusHandlersChange;
|
|
328
|
+
private waitForFutureMatch;
|
|
329
|
+
private findCoreRecordCreatedAfter;
|
|
330
|
+
private waitForEventEmittedCancellable;
|
|
331
|
+
}
|
|
332
|
+
export declare const stableCoreBusId: (bus_name: string) => string;
|
|
333
|
+
export declare const uniqueCoreBusId: () => string;
|
|
334
|
+
export declare const defaultCoreBusId: (bus_name: string, registry: CoreEventBusRegistry) => string;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { EventBus } from './event_bus.js';
|
|
3
|
+
import { EventResult } from './event_result.js';
|
|
4
|
+
import { EventHandler } from './event_handler.js';
|
|
5
|
+
import type { EventConcurrencyMode, EventHandlerConcurrencyMode, EventHandlerCompletionMode, Deferred } from './lock_manager.js';
|
|
6
|
+
import { AsyncLock } from './lock_manager.js';
|
|
7
|
+
import type { EventHandlerCallable, EventResultType } from './types.js';
|
|
8
|
+
export declare const BaseEventSchema: z.ZodObject<{
|
|
9
|
+
event_id: z.ZodString;
|
|
10
|
+
event_created_at: z.ZodString;
|
|
11
|
+
event_type: z.ZodString;
|
|
12
|
+
event_version: z.ZodDefault<z.ZodString>;
|
|
13
|
+
event_timeout: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
event_slow_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
event_handler_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
|
+
event_handler_slow_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
17
|
+
event_blocks_parent_completion: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
event_parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
event_path: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
event_result_type: z.ZodOptional<z.ZodUnknown>;
|
|
21
|
+
event_emitted_by_handler_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
event_pending_bus_count: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
event_status: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
pending: "pending";
|
|
25
|
+
started: "started";
|
|
26
|
+
completed: "completed";
|
|
27
|
+
}>>;
|
|
28
|
+
event_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
event_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
event_results: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
event_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
32
|
+
"global-serial": "global-serial";
|
|
33
|
+
"bus-serial": "bus-serial";
|
|
34
|
+
parallel: "parallel";
|
|
35
|
+
}>>>;
|
|
36
|
+
event_handler_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
37
|
+
parallel: "parallel";
|
|
38
|
+
serial: "serial";
|
|
39
|
+
}>>>;
|
|
40
|
+
event_handler_completion: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
41
|
+
all: "all";
|
|
42
|
+
first: "first";
|
|
43
|
+
}>>>;
|
|
44
|
+
}, z.core.$loose>;
|
|
45
|
+
export type BaseEventData = z.infer<typeof BaseEventSchema>;
|
|
46
|
+
export type BaseEventJSON = BaseEventData & Record<string, unknown>;
|
|
47
|
+
type BaseEventFields = Pick<BaseEventData, 'event_id' | 'event_created_at' | 'event_type' | 'event_version' | 'event_timeout' | 'event_slow_timeout' | 'event_handler_timeout' | 'event_handler_slow_timeout' | 'event_blocks_parent_completion' | 'event_parent_id' | 'event_path' | 'event_result_type' | 'event_emitted_by_handler_id' | 'event_pending_bus_count' | 'event_status' | 'event_started_at' | 'event_completed_at' | 'event_results' | 'event_concurrency' | 'event_handler_concurrency' | 'event_handler_completion'>;
|
|
48
|
+
export type BaseEventInit<TFields extends Record<string, unknown>> = TFields & Partial<BaseEventFields>;
|
|
49
|
+
type BaseEventSchemaShape = typeof BaseEventSchema.shape;
|
|
50
|
+
export type EventSchema<TShape extends z.ZodRawShape> = z.ZodObject<BaseEventSchemaShape & TShape>;
|
|
51
|
+
type EventPayload<TShape extends z.ZodRawShape> = TShape extends Record<string, never> ? {} : z.infer<z.ZodObject<TShape>>;
|
|
52
|
+
type EventInput<TShape extends z.ZodRawShape> = z.input<EventSchema<TShape>>;
|
|
53
|
+
export type EventInit<TShape extends z.ZodRawShape> = Omit<EventInput<TShape>, keyof BaseEventFields> & Partial<BaseEventFields>;
|
|
54
|
+
type EventWithResultSchema<TResult> = BaseEvent & {
|
|
55
|
+
__event_result_type__?: TResult;
|
|
56
|
+
};
|
|
57
|
+
type ResultTypeFromEventResultTypeInput<TInput> = TInput extends z.ZodTypeAny ? z.infer<TInput> : TInput extends StringConstructor ? string : TInput extends NumberConstructor ? number : TInput extends BooleanConstructor ? boolean : TInput extends ArrayConstructor ? unknown[] : TInput extends ObjectConstructor ? Record<string, unknown> : unknown;
|
|
58
|
+
type ResultSchemaFromShape<TShape> = TShape extends {
|
|
59
|
+
event_result_type: infer S;
|
|
60
|
+
} ? ResultTypeFromEventResultTypeInput<S> : unknown;
|
|
61
|
+
type EventResultsListInclude<TEvent extends BaseEvent> = (result: EventResultType<TEvent> | undefined, event_result: EventResult<TEvent>) => boolean;
|
|
62
|
+
type EventResultsListOptions<TEvent extends BaseEvent> = {
|
|
63
|
+
timeout?: number | null;
|
|
64
|
+
include?: EventResultsListInclude<TEvent>;
|
|
65
|
+
raise_if_any?: boolean;
|
|
66
|
+
raise_if_none?: boolean;
|
|
67
|
+
};
|
|
68
|
+
type EventDoneOptions = {
|
|
69
|
+
raise_if_any?: boolean;
|
|
70
|
+
};
|
|
71
|
+
type EventResultUpdateOptions<TEvent extends BaseEvent> = {
|
|
72
|
+
eventbus?: EventBus;
|
|
73
|
+
status?: 'pending' | 'started' | 'completed' | 'error';
|
|
74
|
+
result?: EventResultType<TEvent> | BaseEvent | undefined;
|
|
75
|
+
error?: unknown;
|
|
76
|
+
};
|
|
77
|
+
export type EventFactory<TShape extends z.ZodRawShape, TResult = unknown> = {
|
|
78
|
+
(data: EventInit<TShape>): EventWithResultSchema<TResult> & EventPayload<TShape>;
|
|
79
|
+
new (data: EventInit<TShape>): EventWithResultSchema<TResult> & EventPayload<TShape>;
|
|
80
|
+
schema: EventSchema<TShape>;
|
|
81
|
+
class?: new (data: EventInit<TShape>) => EventWithResultSchema<TResult> & EventPayload<TShape>;
|
|
82
|
+
event_type?: string;
|
|
83
|
+
event_version?: string;
|
|
84
|
+
event_result_type?: z.ZodTypeAny;
|
|
85
|
+
fromJSON?: (data: unknown) => EventWithResultSchema<TResult> & EventPayload<TShape>;
|
|
86
|
+
};
|
|
87
|
+
type ZodShapeFrom<TShape extends Record<string, unknown>> = {
|
|
88
|
+
[K in keyof TShape as K extends 'event_result_type' ? never : TShape[K] extends z.ZodTypeAny ? K : never]: Extract<TShape[K], z.ZodTypeAny>;
|
|
89
|
+
};
|
|
90
|
+
export declare class BaseEvent {
|
|
91
|
+
event_id: string;
|
|
92
|
+
event_created_at: string;
|
|
93
|
+
event_type: string;
|
|
94
|
+
event_version: string;
|
|
95
|
+
event_timeout: number | null;
|
|
96
|
+
event_slow_timeout?: number | null;
|
|
97
|
+
event_handler_timeout?: number | null;
|
|
98
|
+
event_handler_slow_timeout?: number | null;
|
|
99
|
+
event_blocks_parent_completion: boolean;
|
|
100
|
+
event_parent_id: string | null;
|
|
101
|
+
event_path: string[];
|
|
102
|
+
event_result_type?: z.ZodTypeAny;
|
|
103
|
+
event_results: Map<string, EventResult<this>>;
|
|
104
|
+
event_emitted_by_handler_id: string | null;
|
|
105
|
+
event_pending_bus_count: number;
|
|
106
|
+
event_status: 'pending' | 'started' | 'completed';
|
|
107
|
+
event_started_at: string | null;
|
|
108
|
+
event_completed_at: string | null;
|
|
109
|
+
event_concurrency?: EventConcurrencyMode | null;
|
|
110
|
+
event_handler_concurrency?: EventHandlerConcurrencyMode | null;
|
|
111
|
+
event_handler_completion?: EventHandlerCompletionMode | null;
|
|
112
|
+
static event_type?: string;
|
|
113
|
+
static event_version: string;
|
|
114
|
+
static schema: z.ZodObject<{
|
|
115
|
+
event_id: z.ZodString;
|
|
116
|
+
event_created_at: z.ZodString;
|
|
117
|
+
event_type: z.ZodString;
|
|
118
|
+
event_version: z.ZodDefault<z.ZodString>;
|
|
119
|
+
event_timeout: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
event_slow_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
121
|
+
event_handler_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
122
|
+
event_handler_slow_timeout: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
123
|
+
event_blocks_parent_completion: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
event_parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
event_path: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
|
+
event_result_type: z.ZodOptional<z.ZodUnknown>;
|
|
127
|
+
event_emitted_by_handler_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
event_pending_bus_count: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
event_status: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
pending: "pending";
|
|
131
|
+
started: "started";
|
|
132
|
+
completed: "completed";
|
|
133
|
+
}>>;
|
|
134
|
+
event_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
event_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
event_results: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
event_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
138
|
+
"global-serial": "global-serial";
|
|
139
|
+
"bus-serial": "bus-serial";
|
|
140
|
+
parallel: "parallel";
|
|
141
|
+
}>>>;
|
|
142
|
+
event_handler_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
143
|
+
parallel: "parallel";
|
|
144
|
+
serial: "serial";
|
|
145
|
+
}>>>;
|
|
146
|
+
event_handler_completion: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
147
|
+
all: "all";
|
|
148
|
+
first: "first";
|
|
149
|
+
}>>>;
|
|
150
|
+
}, z.core.$loose>;
|
|
151
|
+
event_bus?: EventBus;
|
|
152
|
+
_event_original?: BaseEvent;
|
|
153
|
+
_event_dispatch_context?: unknown | null;
|
|
154
|
+
_event_completed_signal: Deferred<this> | null;
|
|
155
|
+
_lock_for_event_handler: AsyncLock | null;
|
|
156
|
+
constructor(data?: BaseEventInit<Record<string, unknown>>);
|
|
157
|
+
toString(): string;
|
|
158
|
+
static extend<TShape extends z.ZodRawShape>(event_type: string, shape?: TShape): EventFactory<TShape, ResultSchemaFromShape<TShape>>;
|
|
159
|
+
static extend<TShape extends Record<string, unknown>>(event_type: string, shape?: TShape): EventFactory<ZodShapeFrom<TShape>, ResultSchemaFromShape<TShape>>;
|
|
160
|
+
static fromJSON<T extends typeof BaseEvent>(this: T, data: unknown): InstanceType<T>;
|
|
161
|
+
static toJSONArray(events: Iterable<BaseEvent>): BaseEventJSON[];
|
|
162
|
+
static fromJSONArray(data: unknown): BaseEvent[];
|
|
163
|
+
toJSON(): BaseEventJSON;
|
|
164
|
+
_createSlowEventWarningTimer(): ReturnType<typeof setTimeout> | null;
|
|
165
|
+
eventResultUpdate(handler: EventHandler | EventHandlerCallable<this>, options?: EventResultUpdateOptions<this>): EventResult<this>;
|
|
166
|
+
_createPendingHandlerResults(bus: EventBus): Array<{
|
|
167
|
+
handler: EventHandler;
|
|
168
|
+
result: EventResult;
|
|
169
|
+
}>;
|
|
170
|
+
private _collectPendingResults;
|
|
171
|
+
private _isFirstModeWinningResult;
|
|
172
|
+
private _markFirstModeWinnerIfNeeded;
|
|
173
|
+
private _runHandlerWithLock;
|
|
174
|
+
_runHandlers(pending_entries?: Array<{
|
|
175
|
+
handler: EventHandler;
|
|
176
|
+
result: EventResult;
|
|
177
|
+
}>): Promise<void>;
|
|
178
|
+
_getHandlerLock(default_concurrency?: EventHandlerConcurrencyMode): AsyncLock | null;
|
|
179
|
+
_setHandlerLock(lock: AsyncLock | null): void;
|
|
180
|
+
_getDispatchContext(): unknown | null | undefined;
|
|
181
|
+
_setDispatchContext(dispatch_context: unknown | null | undefined): void;
|
|
182
|
+
get event_parent(): BaseEvent | undefined;
|
|
183
|
+
get event_children(): BaseEvent[];
|
|
184
|
+
get event_descendants(): BaseEvent[];
|
|
185
|
+
emit<T extends BaseEvent>(event: T): T;
|
|
186
|
+
_cancelPendingChildProcessing(reason: unknown): void;
|
|
187
|
+
_markRemainingFirstModeResultCancelled(winner: EventResult): void;
|
|
188
|
+
_markCancelled(cause: Error): void;
|
|
189
|
+
_notifyEventParentsOfCompletion(): void;
|
|
190
|
+
done(options?: EventDoneOptions): Promise<this>;
|
|
191
|
+
first(): Promise<EventResultType<this> | undefined>;
|
|
192
|
+
eventResultsList(include: EventResultsListInclude<this>, options?: EventResultsListOptions<this>): Promise<Array<EventResultType<this> | undefined>>;
|
|
193
|
+
eventResultsList(options?: EventResultsListOptions<this>): Promise<Array<EventResultType<this> | undefined>>;
|
|
194
|
+
eventCompleted(): Promise<this>;
|
|
195
|
+
_markBlocksParentCompletionIfAwaitedFromEmittingHandler(): void;
|
|
196
|
+
_markPending(): this;
|
|
197
|
+
eventReset(): this;
|
|
198
|
+
_markStarted(started_at?: string | null, notify_hook?: boolean): void;
|
|
199
|
+
_markCompleted(force?: boolean, notify_parents?: boolean): void;
|
|
200
|
+
private dropFromZeroHistoryBuses;
|
|
201
|
+
get event_errors(): unknown[];
|
|
202
|
+
private _isFirstModeControlError;
|
|
203
|
+
_firstProcessingError(options?: {
|
|
204
|
+
ignore_first_mode_control_errors?: boolean;
|
|
205
|
+
}): unknown | undefined;
|
|
206
|
+
get event_result(): EventResultType<this> | undefined;
|
|
207
|
+
_areAllChildrenComplete(visited?: Set<string>): boolean;
|
|
208
|
+
private _notifyDoneListeners;
|
|
209
|
+
_gc(): void;
|
|
210
|
+
}
|
|
211
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseEvent } from './base_event.js';
|
|
2
|
+
import type { EventClass, EventHandlerCallable, UntypedEventHandlerFunction } from './types.js';
|
|
3
|
+
export declare class JSONLEventBridge {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly poll_interval: number;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
private readonly inbound_bus;
|
|
8
|
+
private running;
|
|
9
|
+
private byte_offset;
|
|
10
|
+
private pending_line;
|
|
11
|
+
private listener_task;
|
|
12
|
+
constructor(path: string, poll_interval?: number, name?: string);
|
|
13
|
+
on<T extends BaseEvent>(event_pattern: EventClass<T>, handler: EventHandlerCallable<T>): void;
|
|
14
|
+
on<T extends BaseEvent>(event_pattern: string | '*', handler: UntypedEventHandlerFunction<T>): void;
|
|
15
|
+
emit<T extends BaseEvent>(event: T): Promise<void>;
|
|
16
|
+
dispatch<T extends BaseEvent>(event: T): Promise<void>;
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
private ensureStarted;
|
|
20
|
+
private listenLoop;
|
|
21
|
+
private pollNewLines;
|
|
22
|
+
private dispatchInboundPayload;
|
|
23
|
+
private readAppended;
|
|
24
|
+
private dirname;
|
|
25
|
+
private loadFs;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseEvent } from './base_event.js';
|
|
2
|
+
import type { EventClass, EventHandlerCallable, UntypedEventHandlerFunction } from './types.js';
|
|
3
|
+
export declare class NATSEventBridge {
|
|
4
|
+
readonly server: string;
|
|
5
|
+
readonly subject: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
private readonly inbound_bus;
|
|
8
|
+
private running;
|
|
9
|
+
private nc;
|
|
10
|
+
private sub_task;
|
|
11
|
+
constructor(server: string, subject: string, name?: string);
|
|
12
|
+
on<T extends BaseEvent>(event_pattern: EventClass<T>, handler: EventHandlerCallable<T>): void;
|
|
13
|
+
on<T extends BaseEvent>(event_pattern: string | '*', handler: UntypedEventHandlerFunction<T>): void;
|
|
14
|
+
emit<T extends BaseEvent>(event: T): Promise<void>;
|
|
15
|
+
dispatch<T extends BaseEvent>(event: T): Promise<void>;
|
|
16
|
+
start(): Promise<void>;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
private ensureStarted;
|
|
19
|
+
private dispatchInboundPayload;
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostgreSQL LISTEN/NOTIFY + flat-table bridge for forwarding events.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseEvent } from './base_event.js';
|
|
5
|
+
import type { EventClass, EventHandlerCallable, UntypedEventHandlerFunction } from './types.js';
|
|
6
|
+
export declare class PostgresEventBridge {
|
|
7
|
+
readonly table_url: string;
|
|
8
|
+
readonly dsn: string;
|
|
9
|
+
readonly table: string;
|
|
10
|
+
readonly channel: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
private readonly inbound_bus;
|
|
13
|
+
private running;
|
|
14
|
+
private client;
|
|
15
|
+
private table_columns;
|
|
16
|
+
private notification_handler;
|
|
17
|
+
constructor(table_url: string, channel?: string, name?: string);
|
|
18
|
+
on<T extends BaseEvent>(event_pattern: EventClass<T>, handler: EventHandlerCallable<T>): void;
|
|
19
|
+
on<T extends BaseEvent>(event_pattern: string | '*', handler: UntypedEventHandlerFunction<T>): void;
|
|
20
|
+
emit<T extends BaseEvent>(event: T): Promise<void>;
|
|
21
|
+
dispatch<T extends BaseEvent>(event: T): Promise<void>;
|
|
22
|
+
start(): Promise<void>;
|
|
23
|
+
close(): Promise<void>;
|
|
24
|
+
private ensureStarted;
|
|
25
|
+
private dispatchByEventId;
|
|
26
|
+
private dispatchInboundPayload;
|
|
27
|
+
private ensureTableExists;
|
|
28
|
+
private ensureBaseIndexes;
|
|
29
|
+
private refreshColumnCache;
|
|
30
|
+
private ensureColumns;
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redis pub/sub bridge for forwarding events between runtimes.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* // channel from URL path
|
|
6
|
+
* const bridge = new RedisEventBridge('redis://user:pass@localhost:6379/1/my_channel')
|
|
7
|
+
*
|
|
8
|
+
* // explicit channel override
|
|
9
|
+
* const bridge2 = new RedisEventBridge('redis://user:pass@localhost:6379/1', 'my_channel')
|
|
10
|
+
*
|
|
11
|
+
* URL format:
|
|
12
|
+
* redis://user:pass@host:6379/<db>/<optional_channel>
|
|
13
|
+
*/
|
|
14
|
+
import { BaseEvent } from './base_event.js';
|
|
15
|
+
import type { EventClass, EventHandlerCallable, UntypedEventHandlerFunction } from './types.js';
|
|
16
|
+
export declare class RedisEventBridge {
|
|
17
|
+
readonly url: string;
|
|
18
|
+
readonly channel: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
private readonly inbound_bus;
|
|
21
|
+
private running;
|
|
22
|
+
private start_promise;
|
|
23
|
+
private redis_pub;
|
|
24
|
+
private redis_sub;
|
|
25
|
+
constructor(redis_url: string, channel?: string, name?: string);
|
|
26
|
+
on<T extends BaseEvent>(event_pattern: EventClass<T>, handler: EventHandlerCallable<T>): void;
|
|
27
|
+
on<T extends BaseEvent>(event_pattern: string | '*', handler: UntypedEventHandlerFunction<T>): void;
|
|
28
|
+
emit<T extends BaseEvent>(event: T): Promise<void>;
|
|
29
|
+
dispatch<T extends BaseEvent>(event: T): Promise<void>;
|
|
30
|
+
start(): Promise<void>;
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
private ensureStarted;
|
|
33
|
+
private dispatchInboundPayload;
|
|
34
|
+
}
|