@hg-ts/async-context 0.8.0 → 0.8.1
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/async-context.not-found.exception 2.js +7 -0
- package/dist/async-context.not-found.exception.d 2.ts +5 -0
- package/dist/async-context.not-found.exception.d.ts 2.map +1 -0
- package/dist/async-context.not-found.exception.js 2.map +1 -0
- package/dist/async-context.provider 2.js +57 -0
- package/dist/async-context.provider.d 2.ts +16 -0
- package/dist/async-context.provider.d.ts 2.map +1 -0
- package/dist/async-context.provider.js 2.map +1 -0
- package/dist/async-context.test 2.js +156 -0
- package/dist/async-context.test.d 2.ts +16 -0
- package/dist/async-context.test.d.ts 2.map +1 -0
- package/dist/async-context.test.js 2.map +1 -0
- package/dist/index 2.js +3 -0
- package/dist/index.d 2.ts +3 -0
- package/dist/index.d.ts 2.map +1 -0
- package/dist/index.js 2.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-context.not-found.exception.d.ts","sourceRoot":"","sources":["../src/async-context.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,6BAA8B,SAAQ,aAAa;;CAI/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-context.not-found.exception.js","sourceRoot":"","sources":["../src/async-context.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,OAAO,6BAA8B,SAAQ,aAAa;IAC/D;QACC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACrC,CAAC;CACD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { Observable, } from 'rxjs';
|
|
3
|
+
import { AsyncContextNotFoundException } from './async-context.not-found.exception.js';
|
|
4
|
+
export class AsyncContextProvider {
|
|
5
|
+
storage = new AsyncLocalStorage();
|
|
6
|
+
get() {
|
|
7
|
+
return this.storage.getStore() ?? null;
|
|
8
|
+
}
|
|
9
|
+
getOrFail() {
|
|
10
|
+
const context = this.get();
|
|
11
|
+
if (typeof context === 'undefined' || context === null) {
|
|
12
|
+
throw new AsyncContextNotFoundException();
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
run(context, callback) {
|
|
17
|
+
return this.storage.run(context, callback);
|
|
18
|
+
}
|
|
19
|
+
exit(callback) {
|
|
20
|
+
return this.storage.exit(callback);
|
|
21
|
+
}
|
|
22
|
+
runOperator(factory) {
|
|
23
|
+
return this.createOperator((next, value) => {
|
|
24
|
+
const context = factory ? factory(value) : value;
|
|
25
|
+
this.storage.run(context, next);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exitOperator() {
|
|
29
|
+
return this.createOperator(next => this.storage.exit(next));
|
|
30
|
+
}
|
|
31
|
+
createOperator(onNext) {
|
|
32
|
+
return (source) => new Observable(subscriber => {
|
|
33
|
+
const callNext = input => {
|
|
34
|
+
const next = () => {
|
|
35
|
+
if (!subscriber.closed) {
|
|
36
|
+
subscriber.next(input);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
onNext(next, input);
|
|
40
|
+
};
|
|
41
|
+
const callError = input => {
|
|
42
|
+
const next = () => {
|
|
43
|
+
if (!subscriber.closed) {
|
|
44
|
+
subscriber.error(input);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
onNext(next, input);
|
|
48
|
+
};
|
|
49
|
+
source.subscribe({
|
|
50
|
+
next: callNext,
|
|
51
|
+
error: callError,
|
|
52
|
+
complete: () => subscriber.complete(),
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=async-context.provider.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { MonoTypeOperatorFunction } from 'rxjs';
|
|
3
|
+
type AsyncContextProviderCallback<T> = () => T;
|
|
4
|
+
type AsyncContextFactory<InputType, Context> = (input: InputType) => Context;
|
|
5
|
+
export declare class AsyncContextProvider<Context> {
|
|
6
|
+
protected readonly storage: AsyncLocalStorage<Context>;
|
|
7
|
+
get(): Nullable<Context>;
|
|
8
|
+
getOrFail(): NonNullable<Context>;
|
|
9
|
+
run<ReturnType>(context: Context, callback: AsyncContextProviderCallback<ReturnType>): ReturnType;
|
|
10
|
+
exit<ReturnType>(callback: AsyncContextProviderCallback<ReturnType>): ReturnType;
|
|
11
|
+
runOperator<T>(factory?: AsyncContextFactory<T, Context>): MonoTypeOperatorFunction<T>;
|
|
12
|
+
exitOperator<T>(): MonoTypeOperatorFunction<T>;
|
|
13
|
+
private createOperator;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=async-context.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-context.provider.d.ts","sourceRoot":"","sources":["../src/async-context.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACN,wBAAwB,EAExB,MAAM,MAAM,CAAC;AAGd,KAAK,4BAA4B,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAC/C,KAAK,mBAAmB,CAAC,SAAS,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;AAI7E,qBAAa,oBAAoB,CAAC,OAAO;IACxC,SAAS,CAAC,QAAQ,CAAC,OAAO,6BAAoC;IAEvD,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC;IAIxB,SAAS,IAAI,WAAW,CAAC,OAAO,CAAC;IAUjC,GAAG,CAAC,UAAU,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,4BAA4B,CAAC,UAAU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CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Describe, expect, ExpectException, Suite, Test, } from '@hg-ts/tests';
|
|
3
|
+
import { Subject, tap, } from 'rxjs';
|
|
4
|
+
import { AsyncContextNotFoundException } from './async-context.not-found.exception.js';
|
|
5
|
+
import { AsyncContextProvider } from './async-context.provider.js';
|
|
6
|
+
let AsyncContextTest = class AsyncContextTest extends Suite {
|
|
7
|
+
context;
|
|
8
|
+
async emptyContext() {
|
|
9
|
+
expect(this.context.get()).toBe(null);
|
|
10
|
+
}
|
|
11
|
+
async noPromiseContext() {
|
|
12
|
+
const contextValue = Math.random();
|
|
13
|
+
const resultValue = Math.random();
|
|
14
|
+
const result = this.context.run(contextValue, () => {
|
|
15
|
+
expect(this.context.getOrFail()).toBe(contextValue);
|
|
16
|
+
this.context.exit(() => {
|
|
17
|
+
expect(this.context.get()).toBe(null);
|
|
18
|
+
});
|
|
19
|
+
return resultValue;
|
|
20
|
+
});
|
|
21
|
+
expect(result).toBe(resultValue);
|
|
22
|
+
}
|
|
23
|
+
async promiseContext() {
|
|
24
|
+
const contextValue = Math.random();
|
|
25
|
+
const resultValue = Math.random();
|
|
26
|
+
const result = await this.context.run(contextValue, async () => {
|
|
27
|
+
expect(this.context.getOrFail()).toBe(contextValue);
|
|
28
|
+
await this.context.exit(async () => {
|
|
29
|
+
expect(this.context.get()).toBe(null);
|
|
30
|
+
});
|
|
31
|
+
return resultValue;
|
|
32
|
+
});
|
|
33
|
+
expect(result).toBe(resultValue);
|
|
34
|
+
}
|
|
35
|
+
async operatorContext() {
|
|
36
|
+
const { subject, input } = this.createOperatorTestSubscription();
|
|
37
|
+
subject.next(input);
|
|
38
|
+
subject.complete();
|
|
39
|
+
expect.assertions(4);
|
|
40
|
+
}
|
|
41
|
+
async operatorWithFactory() {
|
|
42
|
+
const { subject, input } = this.createOperatorTestSubscription(value => -value);
|
|
43
|
+
subject.next(input);
|
|
44
|
+
subject.complete();
|
|
45
|
+
expect.assertions(4);
|
|
46
|
+
}
|
|
47
|
+
async operatorWithErrorContext() {
|
|
48
|
+
const { subject, input } = this.createOperatorTestSubscription();
|
|
49
|
+
subject.error(input);
|
|
50
|
+
subject.complete();
|
|
51
|
+
expect.assertions(4);
|
|
52
|
+
}
|
|
53
|
+
async operatorAfterUnsubscribe() {
|
|
54
|
+
const { subject, input, subscription } = this.createOperatorTestSubscription();
|
|
55
|
+
subscription.unsubscribe();
|
|
56
|
+
subject.next(input);
|
|
57
|
+
subject.complete();
|
|
58
|
+
expect.assertions(2);
|
|
59
|
+
}
|
|
60
|
+
async operatorWithErrorAfterUnsubscribe() {
|
|
61
|
+
const { subject, input, subscription } = this.createOperatorTestSubscription();
|
|
62
|
+
subscription.unsubscribe();
|
|
63
|
+
subject.error(input);
|
|
64
|
+
subject.complete();
|
|
65
|
+
expect.assertions(2);
|
|
66
|
+
}
|
|
67
|
+
async contextNotFound() {
|
|
68
|
+
this.context.getOrFail();
|
|
69
|
+
}
|
|
70
|
+
async beforeEach() {
|
|
71
|
+
this.context = new AsyncContextProvider();
|
|
72
|
+
}
|
|
73
|
+
createOperatorTestSubscription(factory) {
|
|
74
|
+
const subject = new Subject();
|
|
75
|
+
const input = Math.random();
|
|
76
|
+
const context = factory ? factory(input) : input;
|
|
77
|
+
const withContext = (value) => {
|
|
78
|
+
expect(value).toBe(input);
|
|
79
|
+
expect(this.context.getOrFail()).toBe(context);
|
|
80
|
+
};
|
|
81
|
+
const withoutContext = (value) => {
|
|
82
|
+
expect(value).toBe(input);
|
|
83
|
+
expect(this.context.get()).toBe(null);
|
|
84
|
+
};
|
|
85
|
+
const subscription = subject.asObservable()
|
|
86
|
+
.pipe(this.context.runOperator(factory), tap({
|
|
87
|
+
next: withContext,
|
|
88
|
+
error: withContext,
|
|
89
|
+
}), this.context.exitOperator(), tap({
|
|
90
|
+
next: withoutContext,
|
|
91
|
+
error: withoutContext,
|
|
92
|
+
}))
|
|
93
|
+
.subscribe({ next() { }, error() { } });
|
|
94
|
+
return { subject, subscription, input, context };
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
__decorate([
|
|
98
|
+
Test(),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", []),
|
|
101
|
+
__metadata("design:returntype", Promise)
|
|
102
|
+
], AsyncContextTest.prototype, "emptyContext", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
Test(),
|
|
105
|
+
__metadata("design:type", Function),
|
|
106
|
+
__metadata("design:paramtypes", []),
|
|
107
|
+
__metadata("design:returntype", Promise)
|
|
108
|
+
], AsyncContextTest.prototype, "noPromiseContext", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
Test(),
|
|
111
|
+
__metadata("design:type", Function),
|
|
112
|
+
__metadata("design:paramtypes", []),
|
|
113
|
+
__metadata("design:returntype", Promise)
|
|
114
|
+
], AsyncContextTest.prototype, "promiseContext", null);
|
|
115
|
+
__decorate([
|
|
116
|
+
Test(),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", []),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], AsyncContextTest.prototype, "operatorContext", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
Test(),
|
|
123
|
+
__metadata("design:type", Function),
|
|
124
|
+
__metadata("design:paramtypes", []),
|
|
125
|
+
__metadata("design:returntype", Promise)
|
|
126
|
+
], AsyncContextTest.prototype, "operatorWithFactory", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
Test(),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", []),
|
|
131
|
+
__metadata("design:returntype", Promise)
|
|
132
|
+
], AsyncContextTest.prototype, "operatorWithErrorContext", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
Test(),
|
|
135
|
+
__metadata("design:type", Function),
|
|
136
|
+
__metadata("design:paramtypes", []),
|
|
137
|
+
__metadata("design:returntype", Promise)
|
|
138
|
+
], AsyncContextTest.prototype, "operatorAfterUnsubscribe", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
Test(),
|
|
141
|
+
__metadata("design:type", Function),
|
|
142
|
+
__metadata("design:paramtypes", []),
|
|
143
|
+
__metadata("design:returntype", Promise)
|
|
144
|
+
], AsyncContextTest.prototype, "operatorWithErrorAfterUnsubscribe", null);
|
|
145
|
+
__decorate([
|
|
146
|
+
Test(),
|
|
147
|
+
ExpectException(AsyncContextNotFoundException),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", []),
|
|
150
|
+
__metadata("design:returntype", Promise)
|
|
151
|
+
], AsyncContextTest.prototype, "contextNotFound", null);
|
|
152
|
+
AsyncContextTest = __decorate([
|
|
153
|
+
Describe()
|
|
154
|
+
], AsyncContextTest);
|
|
155
|
+
export { AsyncContextTest };
|
|
156
|
+
//# sourceMappingURL=async-context.test.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Suite } from '@hg-ts/tests';
|
|
2
|
+
export declare class AsyncContextTest extends Suite {
|
|
3
|
+
private context;
|
|
4
|
+
emptyContext(): Promise<void>;
|
|
5
|
+
noPromiseContext(): Promise<void>;
|
|
6
|
+
promiseContext(): Promise<void>;
|
|
7
|
+
operatorContext(): Promise<void>;
|
|
8
|
+
operatorWithFactory(): Promise<void>;
|
|
9
|
+
operatorWithErrorContext(): Promise<void>;
|
|
10
|
+
operatorAfterUnsubscribe(): Promise<void>;
|
|
11
|
+
operatorWithErrorAfterUnsubscribe(): Promise<void>;
|
|
12
|
+
contextNotFound(): Promise<void>;
|
|
13
|
+
beforeEach(): Promise<void>;
|
|
14
|
+
private createOperatorTestSubscription;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=async-context.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-context.test.d.ts","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,EAEL,MAAM,cAAc,CAAC;AAiBtB,qBACa,gBAAiB,SAAQ,KAAK;IAC1C,OAAO,CAAC,OAAO,CAA+B;IAGjC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBjC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAUhC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUpC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUzC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWzC,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC;IAYlD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjD,OAAO,CAAC,8BAA8B;CAgCtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-context.test.js","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,QAAQ,EACR,MAAM,EACN,eAAe,EACf,KAAK,EACL,IAAI,GACJ,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,OAAO,EAEP,GAAG,GACH,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU5D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,KAAK;IAClC,OAAO,CAA+B;IAGjC,AAAN,KAAK,CAAC,YAAY;QACxB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAGY,AAAN,KAAK,CAAC,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EACjC,GAAG,CAAC;YACH,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;SAClB,CAAC,EACF,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAC3B,GAAG,CAAC;YACH,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;SACrB,CAAC,CACF;aACA,SAAS,CAAC,EAAE,IAAI,KAAI,CAAC,EAAE,KAAK,KAAI,CAAC,EAAE,CAAC,CAAC;QAEvC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAClD,CAAC;CACD,CAAA;AApIa;IADZ,IAAI,EAAE;;;;oDAGN;AAGY;IADZ,IAAI,EAAE;;;;wDAeN;AAGY;IADZ,IAAI,EAAE;;;;sDAeN;AAGY;IADZ,IAAI,EAAE;;;;uDAQN;AAGY;IADZ,IAAI,EAAE;;;;2DAQN;AAGY;IADZ,IAAI,EAAE;;;;gEAQN;AAGY;IADZ,IAAI,EAAE;;;;gEASN;AAGY;IADZ,IAAI,EAAE;;;;yEASN;AAIY;IAFZ,IAAI,EAAE;IACN,eAAe,CAAC,6BAA6B,CAAC;;;;uDAG9C;AAlGW,gBAAgB;IAD5B,QAAQ,EAAE;GACE,gBAAgB,CAwI5B"}
|
package/dist/index 2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hg-ts/async-context",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"test:dev": "vitest watch"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@hg-ts-config/typescript": "0.8.
|
|
22
|
-
"@hg-ts/exception": "0.8.
|
|
23
|
-
"@hg-ts/linter": "0.8.
|
|
24
|
-
"@hg-ts/tests": "0.8.
|
|
25
|
-
"@hg-ts/types": "0.8.
|
|
21
|
+
"@hg-ts-config/typescript": "0.8.1",
|
|
22
|
+
"@hg-ts/exception": "0.8.1",
|
|
23
|
+
"@hg-ts/linter": "0.8.1",
|
|
24
|
+
"@hg-ts/tests": "0.8.1",
|
|
25
|
+
"@hg-ts/types": "0.8.1",
|
|
26
26
|
"@types/node": "22.19.1",
|
|
27
27
|
"@vitest/coverage-v8": "4.0.14",
|
|
28
28
|
"eslint": "9.18.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"vitest": "4.0.14"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@hg-ts/exception": "0.8.
|
|
38
|
+
"@hg-ts/exception": "0.8.1",
|
|
39
39
|
"reflect-metadata": "*",
|
|
40
40
|
"rxjs": "*",
|
|
41
41
|
"tslib": "*",
|