abxbus 2.5.0 → 2.5.3
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/BaseEvent.d.ts +2 -1
- package/dist/cjs/BaseEvent.js.map +2 -2
- package/dist/cjs/CoreClient.d.ts +167 -0
- package/dist/cjs/CoreEventBus.d.ts +334 -0
- package/dist/cjs/base_event.d.ts +2 -2
- package/dist/cjs/event_handler.d.ts +0 -1
- 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/BaseEvent.js.map +2 -2
- package/dist/esm/retry.js +283 -14
- package/dist/esm/retry.js.map +2 -2
- package/dist/types/BaseEvent.d.ts +2 -1
- package/dist/types/CoreClient.d.ts +167 -0
- package/dist/types/CoreEventBus.d.ts +334 -0
- package/dist/types/base_event.d.ts +2 -2
- package/dist/types/event_handler.d.ts +0 -1
- package/dist/types/retry.d.ts +8 -1
- package/package.json +1 -1
- package/src/BaseEvent.ts +5 -1
- package/src/retry.ts +365 -22
- package/dist/cjs/bridge_ipc.d.ts +0 -45
- package/dist/cjs/middleware_otel_tracing.d.ts +0 -49
- package/dist/types/bridge_ipc.d.ts +0 -45
- package/dist/types/middleware_otel_tracing.d.ts +0 -49
|
@@ -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;
|
package/dist/cjs/base_event.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const BaseEventSchema: z.ZodObject<{
|
|
|
27
27
|
}>>;
|
|
28
28
|
event_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
29
|
event_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
-
event_results: z.ZodOptional<z.
|
|
30
|
+
event_results: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
31
|
event_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
32
32
|
"global-serial": "global-serial";
|
|
33
33
|
"bus-serial": "bus-serial";
|
|
@@ -133,7 +133,7 @@ export declare class BaseEvent {
|
|
|
133
133
|
}>>;
|
|
134
134
|
event_started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
135
|
event_completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
-
event_results: z.ZodOptional<z.
|
|
136
|
+
event_results: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
137
|
event_concurrency: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
138
138
|
"global-serial": "global-serial";
|
|
139
139
|
"bus-serial": "bus-serial";
|
|
@@ -61,7 +61,6 @@ export declare class EventHandler {
|
|
|
61
61
|
eventbus_id: string;
|
|
62
62
|
});
|
|
63
63
|
get _handler_async(): EventHandlerCallable;
|
|
64
|
-
static handlerNameFromCallable(handler: EventHandlerCallable): string;
|
|
65
64
|
static computeHandlerId(params: {
|
|
66
65
|
eventbus_id: string;
|
|
67
66
|
handler_name: string;
|
package/dist/cjs/retry.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
type SemaphoreScope = 'multiprocess' | 'global' | 'class' | 'instance';
|
|
2
|
+
type AnyFunction = (this: any, ...args: any[]) => any;
|
|
3
|
+
type LegacyMethodDescriptor = TypedPropertyDescriptor<AnyFunction>;
|
|
4
|
+
type RetryDecorator = {
|
|
5
|
+
<T extends AnyFunction>(target: T): T;
|
|
6
|
+
<T extends AnyFunction>(target: T, context: ClassMethodDecoratorContext): T;
|
|
7
|
+
(target: object, property_key: string | symbol, descriptor: LegacyMethodDescriptor): LegacyMethodDescriptor;
|
|
8
|
+
};
|
|
2
9
|
export interface RetryOptions {
|
|
3
10
|
/** Total number of attempts including the initial call (1 = no retry, 3 = up to 2 retries). Default: 1 */
|
|
4
11
|
max_attempts?: number;
|
|
@@ -51,5 +58,5 @@ export declare class SemaphoreTimeoutError extends Error {
|
|
|
51
58
|
}
|
|
52
59
|
/** Reset the global semaphore registry. Useful in tests. */
|
|
53
60
|
export declare function clearSemaphoreRegistry(): void;
|
|
54
|
-
export declare function retry(options?: RetryOptions):
|
|
61
|
+
export declare function retry(options?: RetryOptions): RetryDecorator;
|
|
55
62
|
export {};
|