@toa.io/extensions.realtime 1.0.0-alpha.251 → 1.0.0-alpha.252
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/components/realtime.streams/operations/tsconfig.tsbuildinfo +1 -1
- package/features/steps/config.ts +4 -0
- package/package.json +4 -4
- package/source/Receiver.ts +10 -3
- package/transpiled/Receiver.d.ts +1 -0
- package/transpiled/Receiver.js +7 -1
- package/transpiled/Receiver.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
package/features/steps/config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.realtime",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.252",
|
|
4
4
|
"description": "Toa Realtime",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
21
|
-
"openspan": "1.0.0-alpha.
|
|
20
|
+
"@toa.io/core": "1.0.0-alpha.252",
|
|
21
|
+
"openspan": "1.0.0-alpha.252"
|
|
22
22
|
},
|
|
23
23
|
"jest": {
|
|
24
24
|
"preset": "ts-jest",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"transpile": "npx tsc && npx tsc -p ./components/realtime.streams",
|
|
29
29
|
"features": "npx cucumber-js"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "753e94e44b499be02dee28fa1db2d45c053434cf"
|
|
32
32
|
}
|
package/source/Receiver.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { console, decode } from 'openspan'
|
|
1
|
+
import { console, decode, run } from 'openspan'
|
|
2
2
|
import { Connector, type Message } from '@toa.io/core'
|
|
3
3
|
import type { SpanContext } from 'openspan'
|
|
4
4
|
import type { Readable } from 'node:stream'
|
|
@@ -24,11 +24,18 @@ export class Receiver extends Connector {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
public receive (message: Message<Record<string, string>>): void {
|
|
27
|
-
const data = this.fit(message.payload)
|
|
28
|
-
|
|
29
27
|
// the push continues the trace from the producer
|
|
30
28
|
const telemetry = message.telemetry === undefined ? null : decode(message.telemetry)
|
|
31
29
|
|
|
30
|
+
if (telemetry === null)
|
|
31
|
+
this.process(message, telemetry)
|
|
32
|
+
else
|
|
33
|
+
run(telemetry, () => this.process(message, telemetry))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private process (message: Message<Record<string, string>>, telemetry: SpanContext | null): void {
|
|
37
|
+
const data = this.fit(message.payload)
|
|
38
|
+
|
|
32
39
|
for (const property of this.properties) {
|
|
33
40
|
const key = message.payload[property]
|
|
34
41
|
|
package/transpiled/Receiver.d.ts
CHANGED
package/transpiled/Receiver.js
CHANGED
|
@@ -16,9 +16,15 @@ class Receiver extends core_1.Connector {
|
|
|
16
16
|
this.stream = stream;
|
|
17
17
|
}
|
|
18
18
|
receive(message) {
|
|
19
|
-
const data = this.fit(message.payload);
|
|
20
19
|
// the push continues the trace from the producer
|
|
21
20
|
const telemetry = message.telemetry === undefined ? null : (0, openspan_1.decode)(message.telemetry);
|
|
21
|
+
if (telemetry === null)
|
|
22
|
+
this.process(message, telemetry);
|
|
23
|
+
else
|
|
24
|
+
(0, openspan_1.run)(telemetry, () => this.process(message, telemetry));
|
|
25
|
+
}
|
|
26
|
+
process(message, telemetry) {
|
|
27
|
+
const data = this.fit(message.payload);
|
|
22
28
|
for (const property of this.properties) {
|
|
23
29
|
const key = message.payload[property];
|
|
24
30
|
if (key === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Receiver.js","sourceRoot":"","sources":["../source/Receiver.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