abxbus 2.4.1 → 2.4.15
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/README.md +19 -7
- package/dist/cjs/base_event.d.ts +8 -4
- package/dist/cjs/base_event.js +98 -38
- package/dist/cjs/base_event.js.map +2 -2
- package/dist/cjs/event_bus.d.ts +0 -2
- package/dist/cjs/event_bus.js +13 -46
- package/dist/cjs/event_bus.js.map +2 -2
- package/dist/cjs/event_result.js +2 -2
- package/dist/cjs/event_result.js.map +1 -1
- package/dist/cjs/lock_manager.d.ts +1 -1
- package/dist/cjs/lock_manager.js +9 -6
- package/dist/cjs/lock_manager.js.map +2 -2
- package/dist/cjs/logging.js +5 -2
- package/dist/cjs/logging.js.map +2 -2
- package/dist/cjs/retry.d.ts +4 -1
- package/dist/cjs/retry.js +139 -12
- package/dist/cjs/retry.js.map +2 -2
- package/dist/esm/base_event.js +98 -38
- package/dist/esm/base_event.js.map +2 -2
- package/dist/esm/event_bus.js +13 -46
- package/dist/esm/event_bus.js.map +2 -2
- package/dist/esm/event_result.js +2 -2
- package/dist/esm/event_result.js.map +1 -1
- package/dist/esm/lock_manager.js +9 -6
- package/dist/esm/lock_manager.js.map +2 -2
- package/dist/esm/logging.js +6 -3
- package/dist/esm/logging.js.map +2 -2
- package/dist/esm/retry.js +139 -12
- package/dist/esm/retry.js.map +2 -2
- package/dist/types/base_event.d.ts +8 -4
- package/dist/types/event_bus.d.ts +0 -2
- package/dist/types/lock_manager.d.ts +1 -1
- package/dist/types/retry.d.ts +4 -1
- package/package.json +3 -3
|
@@ -112,14 +112,12 @@ export declare class EventBus {
|
|
|
112
112
|
eventIsParentOf(parent_event: BaseEvent, child_event: BaseEvent): boolean;
|
|
113
113
|
logTree(): string;
|
|
114
114
|
findEventById(event_id: string): BaseEvent | null;
|
|
115
|
-
_getParentEventResultAcrossAllBuses(event: BaseEvent): EventResult | null;
|
|
116
115
|
private _startRunloop;
|
|
117
116
|
private _processEvent;
|
|
118
117
|
_processEventImmediately<T extends BaseEvent>(event: T, handler_result?: EventResult): Promise<T>;
|
|
119
118
|
private _processEventImmediatelyAcrossBuses;
|
|
120
119
|
private _runloop;
|
|
121
120
|
_hasProcessedEvent(event: BaseEvent): boolean;
|
|
122
|
-
private _resolveImplicitParentHandlerResult;
|
|
123
121
|
_getEventProxyScopedToThisBus<T extends BaseEvent>(event: T, handler_result?: EventResult): T;
|
|
124
122
|
private _resolveFindWaiters;
|
|
125
123
|
_getHandlersForEvent(event: BaseEvent): EventHandler[];
|
|
@@ -54,7 +54,7 @@ export declare class LockManager {
|
|
|
54
54
|
_waitUntilRunloopResumed(): Promise<void>;
|
|
55
55
|
_isPaused(): boolean;
|
|
56
56
|
_runWithHandlerDispatchContext<T>(result: EventResult, fn: () => Promise<T>): Promise<T>;
|
|
57
|
-
|
|
57
|
+
_getActiveHandlerResultForCurrentAsyncContext(): EventResult | undefined;
|
|
58
58
|
_getActiveHandlerResults(): EventResult[];
|
|
59
59
|
_isAnyHandlerActive(): boolean;
|
|
60
60
|
waitForIdle(timeout_seconds?: number | null): Promise<boolean>;
|
package/dist/types/retry.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type SemaphoreScope = 'multiprocess' | 'global' | 'class' | 'instance';
|
|
1
2
|
export interface RetryOptions {
|
|
2
3
|
/** Total number of attempts including the initial call (1 = no retry, 3 = up to 2 retries). Default: 1 */
|
|
3
4
|
max_attempts?: number;
|
|
@@ -19,11 +20,12 @@ export interface RetryOptions {
|
|
|
19
20
|
/** If true, proceed without concurrency limit when semaphore acquisition times out. Default: true */
|
|
20
21
|
semaphore_lax?: boolean;
|
|
21
22
|
/** Semaphore scoping strategy. Default: 'global'
|
|
23
|
+
* - 'multiprocess': all processes on the machine share one semaphore (Node.js only)
|
|
22
24
|
* - 'global': all calls share one semaphore (keyed by semaphore_name)
|
|
23
25
|
* - 'class': all instances of the same class share one semaphore (keyed by className.semaphore_name)
|
|
24
26
|
* - 'instance': each object instance gets its own semaphore (keyed by instanceId.semaphore_name)
|
|
25
27
|
* 'class' and 'instance' require `this` to be an object; they fall back to 'global' for standalone calls. */
|
|
26
|
-
semaphore_scope?:
|
|
28
|
+
semaphore_scope?: SemaphoreScope;
|
|
27
29
|
/** Maximum seconds to wait for semaphore acquisition. Default: undefined → timeout * max(1, limit - 1) */
|
|
28
30
|
semaphore_timeout?: number | null;
|
|
29
31
|
}
|
|
@@ -50,3 +52,4 @@ export declare class SemaphoreTimeoutError extends Error {
|
|
|
50
52
|
/** Reset the global semaphore registry. Useful in tests. */
|
|
51
53
|
export declare function clearSemaphoreRegistry(): void;
|
|
52
54
|
export declare function retry(options?: RetryOptions): <T extends (...args: any[]) => any>(target: T, _context?: ClassMethodDecoratorContext) => T;
|
|
55
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abxbus",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.15",
|
|
4
4
|
"description": "Event bus library for browsers and ESM Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|
|
49
|
-
"url": "git+https://github.com/ArchiveBox/
|
|
49
|
+
"url": "git+https://github.com/ArchiveBox/abxbus.git",
|
|
50
50
|
"directory": "abxbus-ts"
|
|
51
51
|
},
|
|
52
52
|
"bugs": {
|
|
53
|
-
"url": "https://github.com/ArchiveBox/
|
|
53
|
+
"url": "https://github.com/ArchiveBox/abxbus/issues"
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://abxbus.archivebox.io",
|
|
56
56
|
"publishConfig": {
|