eimer 0.1.1 → 0.2.0
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 +12 -6
- package/dist/cjs/eimer/Eimer.d.ts +9 -5
- package/dist/cjs/eimer/Eimer.d.ts.map +1 -1
- package/dist/cjs/eimer/Eimer.js +28 -10
- package/dist/cjs/eimer/Eimer.js.map +1 -1
- package/dist/cjs/eimer/EimerDependencies.d.ts +2 -0
- package/dist/cjs/eimer/EimerDependencies.d.ts.map +1 -1
- package/dist/cjs/eimer/EimerDependencies.js.map +1 -1
- package/dist/cjs/eimer/EimerMessage.d.ts +4 -1
- package/dist/cjs/eimer/EimerMessage.d.ts.map +1 -1
- package/dist/cjs/eimer/EimerMessage.js +3 -1
- package/dist/cjs/eimer/EimerMessage.js.map +1 -1
- package/dist/cjs/eimer/EimerMessageMeta.d.ts +17 -0
- package/dist/cjs/eimer/EimerMessageMeta.d.ts.map +1 -0
- package/dist/cjs/eimer/EimerMessageMeta.js +3 -0
- package/dist/cjs/eimer/EimerMessageMeta.js.map +1 -0
- package/dist/cjs/eimer/PayloadHandler.d.ts +2 -1
- package/dist/cjs/eimer/PayloadHandler.d.ts.map +1 -1
- package/dist/cjs/eimer/RpcHandler.d.ts +2 -1
- package/dist/cjs/eimer/RpcHandler.d.ts.map +1 -1
- package/dist/cjs/eimer/RpcManager.d.ts +4 -2
- package/dist/cjs/eimer/RpcManager.d.ts.map +1 -1
- package/dist/cjs/eimer/TraceContext.d.ts +13 -0
- package/dist/cjs/eimer/TraceContext.d.ts.map +1 -0
- package/dist/cjs/eimer/TraceContext.js +3 -0
- package/dist/cjs/eimer/TraceContext.js.map +1 -0
- package/dist/cjs/eimer/TraceSpan.d.ts +14 -0
- package/dist/cjs/eimer/TraceSpan.d.ts.map +1 -0
- package/dist/cjs/eimer/TraceSpan.js +3 -0
- package/dist/cjs/eimer/TraceSpan.js.map +1 -0
- package/dist/cjs/eimer/Tracer.d.ts +34 -0
- package/dist/cjs/eimer/Tracer.d.ts.map +1 -0
- package/dist/cjs/eimer/Tracer.js +3 -0
- package/dist/cjs/eimer/Tracer.js.map +1 -0
- package/dist/cjs/eimer/TracerBackend.d.ts +21 -0
- package/dist/cjs/eimer/TracerBackend.d.ts.map +1 -0
- package/dist/cjs/eimer/TracerBackend.js +3 -0
- package/dist/cjs/eimer/TracerBackend.js.map +1 -0
- package/dist/cjs/eimer/index.d.ts +5 -0
- package/dist/cjs/eimer/index.d.ts.map +1 -1
- package/dist/cjs/eimer/index.js +5 -0
- package/dist/cjs/eimer/index.js.map +1 -1
- package/dist/cjs/eimer/now.d.ts +12 -0
- package/dist/cjs/eimer/now.d.ts.map +1 -0
- package/dist/cjs/eimer/now.js +17 -0
- package/dist/cjs/eimer/now.js.map +1 -0
- package/dist/cjs/message-bus/EimerMessageBus.d.ts +3 -2
- package/dist/cjs/message-bus/EimerMessageBus.d.ts.map +1 -1
- package/dist/cjs/message-bus/EimerMessageBus.js +21 -3
- package/dist/cjs/message-bus/EimerMessageBus.js.map +1 -1
- package/dist/cjs/rpc/EimerRpcManager.d.ts +9 -6
- package/dist/cjs/rpc/EimerRpcManager.d.ts.map +1 -1
- package/dist/cjs/rpc/EimerRpcManager.js +31 -9
- package/dist/cjs/rpc/EimerRpcManager.js.map +1 -1
- package/dist/cjs/rpc/EimerRpcRequestMessage.d.ts +2 -1
- package/dist/cjs/rpc/EimerRpcRequestMessage.d.ts.map +1 -1
- package/dist/cjs/rpc/EimerRpcRequestMessage.js +2 -2
- package/dist/cjs/rpc/EimerRpcRequestMessage.js.map +1 -1
- package/dist/cjs/rpc/EimerRpcResponseMessage.d.ts +2 -1
- package/dist/cjs/rpc/EimerRpcResponseMessage.d.ts.map +1 -1
- package/dist/cjs/rpc/EimerRpcResponseMessage.js +2 -2
- package/dist/cjs/rpc/EimerRpcResponseMessage.js.map +1 -1
- package/dist/cjs/tracing/ConsoleLoggingTracerBackend.d.ts +53 -0
- package/dist/cjs/tracing/ConsoleLoggingTracerBackend.d.ts.map +1 -0
- package/dist/cjs/tracing/ConsoleLoggingTracerBackend.js +113 -0
- package/dist/cjs/tracing/ConsoleLoggingTracerBackend.js.map +1 -0
- package/dist/cjs/tracing/EimerLoggerTracerBackend.d.ts +12 -0
- package/dist/cjs/tracing/EimerLoggerTracerBackend.d.ts.map +1 -0
- package/dist/cjs/tracing/EimerLoggerTracerBackend.js +18 -0
- package/dist/cjs/tracing/EimerLoggerTracerBackend.js.map +1 -0
- package/dist/cjs/tracing/EimerNoopTracer.d.ts +17 -0
- package/dist/cjs/tracing/EimerNoopTracer.d.ts.map +1 -0
- package/dist/cjs/tracing/EimerNoopTracer.js +27 -0
- package/dist/cjs/tracing/EimerNoopTracer.js.map +1 -0
- package/dist/cjs/tracing/EimerPublishingTracerBackend.d.ts +17 -0
- package/dist/cjs/tracing/EimerPublishingTracerBackend.d.ts.map +1 -0
- package/dist/cjs/tracing/EimerPublishingTracerBackend.js +20 -0
- package/dist/cjs/tracing/EimerPublishingTracerBackend.js.map +1 -0
- package/dist/cjs/tracing/EimerTraceSubscriber.d.ts +17 -0
- package/dist/cjs/tracing/EimerTraceSubscriber.d.ts.map +1 -0
- package/dist/cjs/tracing/EimerTraceSubscriber.js +23 -0
- package/dist/cjs/tracing/EimerTraceSubscriber.js.map +1 -0
- package/dist/cjs/tracing/EimerTracer.d.ts +21 -0
- package/dist/cjs/tracing/EimerTracer.d.ts.map +1 -0
- package/dist/cjs/tracing/EimerTracer.js +59 -0
- package/dist/cjs/tracing/EimerTracer.js.map +1 -0
- package/dist/cjs/tracing/MemoryTracerBackend.d.ts +14 -0
- package/dist/cjs/tracing/MemoryTracerBackend.d.ts.map +1 -0
- package/dist/cjs/tracing/MemoryTracerBackend.js +24 -0
- package/dist/cjs/tracing/MemoryTracerBackend.js.map +1 -0
- package/dist/cjs/tracing/NoopTracer.d.ts +16 -0
- package/dist/cjs/tracing/NoopTracer.d.ts.map +1 -0
- package/dist/cjs/tracing/NoopTracer.js +27 -0
- package/dist/cjs/tracing/NoopTracer.js.map +1 -0
- package/dist/cjs/tracing/index.d.ts +9 -0
- package/dist/cjs/tracing/index.d.ts.map +1 -0
- package/dist/cjs/tracing/index.js +25 -0
- package/dist/cjs/tracing/index.js.map +1 -0
- package/dist/cjs/tracing/now.d.ts +9 -0
- package/dist/cjs/tracing/now.d.ts.map +1 -0
- package/dist/cjs/tracing/now.js +14 -0
- package/dist/cjs/tracing/now.js.map +1 -0
- package/dist/cjs/transports/EimerUtilityProcessTransport.d.ts +5 -2
- package/dist/cjs/transports/EimerUtilityProcessTransport.d.ts.map +1 -1
- package/dist/cjs/transports/EimerUtilityProcessTransport.js +29 -1
- package/dist/cjs/transports/EimerUtilityProcessTransport.js.map +1 -1
- package/dist/esm/eimer/Eimer.js +28 -10
- package/dist/esm/eimer/Eimer.js.map +1 -1
- package/dist/esm/eimer/EimerDependencies.js.map +1 -1
- package/dist/esm/eimer/EimerMessage.js +3 -1
- package/dist/esm/eimer/EimerMessage.js.map +1 -1
- package/dist/esm/eimer/EimerMessageMeta.js +2 -0
- package/dist/esm/eimer/EimerMessageMeta.js.map +1 -0
- package/dist/esm/eimer/TraceContext.js +2 -0
- package/dist/esm/eimer/TraceContext.js.map +1 -0
- package/dist/esm/eimer/TraceSpan.js +2 -0
- package/dist/esm/eimer/TraceSpan.js.map +1 -0
- package/dist/esm/eimer/Tracer.js +2 -0
- package/dist/esm/eimer/Tracer.js.map +1 -0
- package/dist/esm/eimer/TracerBackend.js +2 -0
- package/dist/esm/eimer/TracerBackend.js.map +1 -0
- package/dist/esm/eimer/index.js +5 -0
- package/dist/esm/eimer/index.js.map +1 -1
- package/dist/esm/eimer/now.js +14 -0
- package/dist/esm/eimer/now.js.map +1 -0
- package/dist/esm/message-bus/EimerMessageBus.js +21 -3
- package/dist/esm/message-bus/EimerMessageBus.js.map +1 -1
- package/dist/esm/rpc/EimerRpcManager.js +31 -9
- package/dist/esm/rpc/EimerRpcManager.js.map +1 -1
- package/dist/esm/rpc/EimerRpcRequestMessage.js +2 -2
- package/dist/esm/rpc/EimerRpcRequestMessage.js.map +1 -1
- package/dist/esm/rpc/EimerRpcResponseMessage.js +2 -2
- package/dist/esm/rpc/EimerRpcResponseMessage.js.map +1 -1
- package/dist/esm/tracing/ConsoleLoggingTracerBackend.js +109 -0
- package/dist/esm/tracing/ConsoleLoggingTracerBackend.js.map +1 -0
- package/dist/esm/tracing/EimerLoggerTracerBackend.js +14 -0
- package/dist/esm/tracing/EimerLoggerTracerBackend.js.map +1 -0
- package/dist/esm/tracing/EimerNoopTracer.js +23 -0
- package/dist/esm/tracing/EimerNoopTracer.js.map +1 -0
- package/dist/esm/tracing/EimerPublishingTracerBackend.js +16 -0
- package/dist/esm/tracing/EimerPublishingTracerBackend.js.map +1 -0
- package/dist/esm/tracing/EimerTraceSubscriber.js +19 -0
- package/dist/esm/tracing/EimerTraceSubscriber.js.map +1 -0
- package/dist/esm/tracing/EimerTracer.js +55 -0
- package/dist/esm/tracing/EimerTracer.js.map +1 -0
- package/dist/esm/tracing/MemoryTracerBackend.js +20 -0
- package/dist/esm/tracing/MemoryTracerBackend.js.map +1 -0
- package/dist/esm/tracing/NoopTracer.js +30 -0
- package/dist/esm/tracing/NoopTracer.js.map +1 -0
- package/dist/esm/tracing/index.js +9 -0
- package/dist/esm/tracing/index.js.map +1 -0
- package/dist/esm/tracing/now.js +11 -0
- package/dist/esm/tracing/now.js.map +1 -0
- package/dist/esm/transports/EimerUtilityProcessTransport.js +29 -1
- package/dist/esm/transports/EimerUtilityProcessTransport.js.map +1 -1
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ It is written in [TypeScript](https://www.typescriptlang.org/) and comes with mi
|
|
|
16
16
|
- [Add eimer.js to the Preload Script](#add-eimerjs-to-the-preload-script)
|
|
17
17
|
- [Add eimer.js to the Browser Window](#add-eimerjs-to-the-browser-window)
|
|
18
18
|
- [Build Process Considerations](#build-process-considerations)
|
|
19
|
+
- [Tracing](#tracing)
|
|
19
20
|
- [Limitations](#limitations)
|
|
20
21
|
- [Authors](#authors)
|
|
21
22
|
- [License](#license)
|
|
@@ -23,7 +24,7 @@ It is written in [TypeScript](https://www.typescriptlang.org/) and comes with mi
|
|
|
23
24
|
## What problem(s) does it solve?
|
|
24
25
|
Even simple Electron applications are naturally [split into two different processes](https://www.electronjs.org/docs/latest/tutorial/process-model) (main and renderer), which have to be linked through a "preload script". Exchanging data and calling functions across these process boundaries is already non-trivial and the [interfaces provided by Electron](https://www.electronjs.org/docs/latest/tutorial/ipc) make it difficult to keep a growing code base maintainable.
|
|
25
26
|
|
|
26
|
-
As applications grow in functionality and complexity, even more processes become involved - [multiple windows](https://www.electronjs.org/docs/latest/api/base-window) on the rendering side, each potentially with [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) or iframes and the main process can start [worker threads](https://nodejs.org/api/worker_threads.html) or spawn [utility processes](https://www.electronjs.org/docs/latest/api/utility-process) which themselves can spawn more processes and threads.
|
|
27
|
+
As applications grow in functionality and complexity, even more processes become involved - [multiple windows](https://www.electronjs.org/docs/latest/api/base-window) on the rendering side, each potentially with [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) or iframes; and the main process can start [worker threads](https://nodejs.org/api/worker_threads.html) or spawn [utility processes](https://www.electronjs.org/docs/latest/api/utility-process), which themselves can spawn more processes and threads.
|
|
27
28
|
|
|
28
29
|
All of the different process-like concepts in Electron have slightly different APIs for inter-process communication and while [MessagePorts](https://www.electronjs.org/docs/latest/tutorial/message-ports) can be used to unify these concepts, even these are limited to point-to-point communication between at most *two* processes at a time.
|
|
29
30
|
|
|
@@ -37,7 +38,7 @@ All of the different process-like concepts in Electron have slightly different A
|
|
|
37
38
|
## Getting Started
|
|
38
39
|
We'll assume that you already have an Electron.js project that is written in TypeScript and it can be compiled / started.
|
|
39
40
|
|
|
40
|
-
If not, check out the [examples](./examples) directory! It also contains examples that show how to implement a [basic counter](./examples/basic-counter/) with RPC and publish/subscribe and how to extend that to [multiple windows](./examples/multi-window/) or [worker threads](./examples/worker-thread/).
|
|
41
|
+
If not, check out the [`examples`](./examples) directory! It also contains examples that show how to implement a [basic counter](./examples/basic-counter/) with RPC and publish/subscribe and how to extend that to [multiple windows](./examples/multi-window/) or [worker threads](./examples/worker-thread/).
|
|
41
42
|
|
|
42
43
|
### Install eimer.js
|
|
43
44
|
```shell
|
|
@@ -73,7 +74,7 @@ app.whenReady().then(() => {
|
|
|
73
74
|
### Add eimer.js to the *Preload Script*
|
|
74
75
|
The purpose of the [Preload Script](https://www.electronjs.org/docs/latest/tutorial/tutorial-preload) is to set up communication between the main process and the "browser" window, without exposing too many APIs of the main process in the browser context.
|
|
75
76
|
|
|
76
|
-
We set up another instance of eimer.js in the preload script, which simply forwards messages. It uses Electron's [ipcRenderer](https://www.electronjs.org/docs/latest/api/ipc-renderer) to communicate with the main process and [window.postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to communicate with the
|
|
77
|
+
We set up another instance of eimer.js in the preload script, which simply forwards messages. It uses Electron's [ipcRenderer](https://www.electronjs.org/docs/latest/api/ipc-renderer) to communicate with the main process and [window.postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) to communicate with the browser window.
|
|
77
78
|
```typescript
|
|
78
79
|
import { ipcRenderer } from 'electron';
|
|
79
80
|
import { Eimer, EimerIpcRendererTransport, EimerBrowserTransport } from 'eimer';
|
|
@@ -95,14 +96,14 @@ eimer.callRpc<string>('hello').then(value => { console.log('hello ' + value) });
|
|
|
95
96
|
```
|
|
96
97
|
|
|
97
98
|
### Build Process Considerations
|
|
98
|
-
* The Preload Script as well as the Renderer / Browser Code
|
|
99
|
+
* The Preload Script as well as the Renderer / Browser Code runs inside separate browser environments and needs to be separately compiled and bundled with the eimer.js library.
|
|
99
100
|
* This is not specific to eimer.js but a general pitfall of Electron Applications
|
|
100
101
|
* You can add extra build scripts to the `package.json` that rely on esbuild (`npm install esbuild`)
|
|
101
102
|
```json
|
|
102
103
|
"scripts": {
|
|
103
104
|
"build": "tsc && npm run build:preload && npm run build:renderer",
|
|
104
105
|
"build:preload": "esbuild src/preload.ts --bundle --outfile=dist/preload.js --external:electron",
|
|
105
|
-
"build:renderer": "esbuild src/renderer.ts --bundle --outfile=dist/renderer.js"
|
|
106
|
+
"build:renderer": "esbuild src/renderer.ts --bundle --outfile=dist/renderer.js"
|
|
106
107
|
}
|
|
107
108
|
```
|
|
108
109
|
* Be sure to call the `npm run build:preload` and the `npm run build:renderer` scripts in your build process!
|
|
@@ -112,12 +113,17 @@ eimer.callRpc<string>('hello').then(value => { console.log('hello ' + value) });
|
|
|
112
113
|
* `--format=cjs`
|
|
113
114
|
* Check out the [examples](./examples) directory for complete projects including build configurations.
|
|
114
115
|
|
|
116
|
+
## Tracing
|
|
117
|
+
* eimer.js supports forwarding of tracing information
|
|
118
|
+
* It ships with tooling to collect distributed tracing information across an application's entire process tree
|
|
119
|
+
* For details and more info, see [docs/TRACING](docs/TRACING.md)
|
|
120
|
+
|
|
115
121
|
## Limitations
|
|
116
122
|
This library is in pre-beta stage.
|
|
117
123
|
|
|
118
124
|
Existing functionality mostly works and is well tested. However, performance is not optimized at all
|
|
119
125
|
(for example, all messages are broadcast to all connected processes, the ids of all messages ever sent
|
|
120
|
-
|
|
126
|
+
are kept in memory indefinitely) and features are limited (security and extensibility need improvement).
|
|
121
127
|
|
|
122
128
|
Also the documentation is lacking.
|
|
123
129
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EimerDependencies } from './EimerDependencies';
|
|
2
|
+
import type { EimerMessageMeta } from './EimerMessageMeta';
|
|
2
3
|
import type { EimerOptions } from './EimerOptions';
|
|
3
4
|
import type { NodeId } from './NodeId';
|
|
4
5
|
import type { PayloadHandler } from './PayloadHandler';
|
|
@@ -22,6 +23,7 @@ export declare class Eimer {
|
|
|
22
23
|
private readonly messageBus;
|
|
23
24
|
private readonly rpcManager;
|
|
24
25
|
private readonly logger;
|
|
26
|
+
private readonly tracer;
|
|
25
27
|
private handlerMap;
|
|
26
28
|
/**
|
|
27
29
|
*
|
|
@@ -46,10 +48,11 @@ export declare class Eimer {
|
|
|
46
48
|
* Will throw on errors from handler
|
|
47
49
|
* @param method name of method / rpc handler
|
|
48
50
|
* @param params optional params object
|
|
49
|
-
* @param
|
|
51
|
+
* @param timeoutMs override timeout, in milliseconds, from constructor options for this single call
|
|
52
|
+
* @param meta optional metadata to attach to the request
|
|
50
53
|
* @returns result from invoked handler
|
|
51
54
|
*/
|
|
52
|
-
callRpc<T>(method: RpcMethod, params?: unknown,
|
|
55
|
+
callRpc<T>(method: RpcMethod, params?: unknown, timeoutMs?: number, meta?: EimerMessageMeta): Promise<T>;
|
|
53
56
|
/**
|
|
54
57
|
* Register an RPC handler
|
|
55
58
|
* Will be called if callRpc is called on any connected Eimer instance
|
|
@@ -68,8 +71,9 @@ export declare class Eimer {
|
|
|
68
71
|
* Will send payload to all subscribers on the topic
|
|
69
72
|
* @param topic name of topic - subscribers can subscribe to it
|
|
70
73
|
* @param payload payload will be sent to subscribers
|
|
74
|
+
* @param meta optional metadata to attach to the message
|
|
71
75
|
*/
|
|
72
|
-
publish(topic: Topic, payload?: unknown): void;
|
|
76
|
+
publish(topic: Topic, payload?: unknown, meta?: EimerMessageMeta): void;
|
|
73
77
|
/**
|
|
74
78
|
* Subscribe a handler function to a topic
|
|
75
79
|
* The handler function will be called with the payload everytime a message is published
|
|
@@ -92,8 +96,8 @@ export declare class Eimer {
|
|
|
92
96
|
unsubscribeAll(topic: Topic): void;
|
|
93
97
|
/**
|
|
94
98
|
* Shutdown this Eimer instance
|
|
95
|
-
* Will reject all RPC requests that are still waiting for a response
|
|
96
|
-
* and shutdown the
|
|
99
|
+
* Will reject all RPC requests that are still waiting for a response,
|
|
100
|
+
* shutdown the MessageBus, and shutdown the Tracer
|
|
97
101
|
*/
|
|
98
102
|
shutdown(): void;
|
|
99
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Eimer.d.ts","sourceRoot":"","sources":["../../../src/eimer/Eimer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Eimer.d.ts","sourceRoot":"","sources":["../../../src/eimer/Eimer.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;GASG;AACH,qBAAa,KAAK;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAGhC,OAAO,CAAC,UAAU,CAA8D;IAEhF;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,iBAAiB;IASpF;;;OAGG;IACH,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAKnC;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAKtC;;;;;;;;;OASG;IACG,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IAK9G;;;;;;OAMG;IACH,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAKhE;;;OAGG;IACH,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAK7C;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,IAAI;IA0BvE;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,IAAI;IA0CnE;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,GAAG,IAAI;IAgB/D;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAalC;;;;OAIG;IACH,QAAQ,IAAI,IAAI;CAMnB"}
|
package/dist/cjs/eimer/Eimer.js
CHANGED
|
@@ -7,6 +7,7 @@ const EimerIdGenerator_1 = require("../id-generator/EimerIdGenerator");
|
|
|
7
7
|
const EimerLogger_1 = require("../logger/EimerLogger");
|
|
8
8
|
const EimerMessageBus_1 = require("../message-bus/EimerMessageBus");
|
|
9
9
|
const EimerRpcManager_1 = require("../rpc/EimerRpcManager");
|
|
10
|
+
const EimerNoopTracer_1 = require("../tracing/EimerNoopTracer");
|
|
10
11
|
/**
|
|
11
12
|
* Eimer main class
|
|
12
13
|
* This class represents an instance of a "node" on the Eimer "network".
|
|
@@ -31,8 +32,9 @@ class Eimer {
|
|
|
31
32
|
this.nodeId = nodeId;
|
|
32
33
|
this.idGenerator = dependencies?.idGenerator ?? new EimerIdGenerator_1.EimerIdGenerator();
|
|
33
34
|
this.logger = dependencies?.logger ?? new EimerLogger_1.EimerLogger(options?.logLevel ?? LogLevel_1.LogLevel.DEBUG, options?.logModuleName ?? 'Eimer', this.nodeId);
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
35
|
+
this.tracer = dependencies?.tracer ?? new EimerNoopTracer_1.EimerNoopTracer();
|
|
36
|
+
this.messageBus = dependencies?.messageBus ?? new EimerMessageBus_1.EimerMessageBus(this.nodeId, options, { tracer: this.tracer });
|
|
37
|
+
this.rpcManager = dependencies?.rpcManager ?? new EimerRpcManager_1.EimerRpcManager(this.nodeId, this.messageBus, options, { tracer: this.tracer });
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Connect this Eimer instance to a `Transport`
|
|
@@ -56,12 +58,13 @@ class Eimer {
|
|
|
56
58
|
* Will throw on errors from handler
|
|
57
59
|
* @param method name of method / rpc handler
|
|
58
60
|
* @param params optional params object
|
|
59
|
-
* @param
|
|
61
|
+
* @param timeoutMs override timeout, in milliseconds, from constructor options for this single call
|
|
62
|
+
* @param meta optional metadata to attach to the request
|
|
60
63
|
* @returns result from invoked handler
|
|
61
64
|
*/
|
|
62
|
-
async callRpc(method, params,
|
|
65
|
+
async callRpc(method, params, timeoutMs, meta) {
|
|
63
66
|
this.logger.debug('Making RPC call', { method, params });
|
|
64
|
-
return this.rpcManager.call(method, params,
|
|
67
|
+
return this.rpcManager.call(method, params, timeoutMs, meta);
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Register an RPC handler
|
|
@@ -87,10 +90,17 @@ class Eimer {
|
|
|
87
90
|
* Will send payload to all subscribers on the topic
|
|
88
91
|
* @param topic name of topic - subscribers can subscribe to it
|
|
89
92
|
* @param payload payload will be sent to subscribers
|
|
93
|
+
* @param meta optional metadata to attach to the message
|
|
90
94
|
*/
|
|
91
|
-
publish(topic, payload) {
|
|
95
|
+
publish(topic, payload, meta) {
|
|
92
96
|
this.logger.debug('Publishing message', { topic });
|
|
93
|
-
|
|
97
|
+
if (meta?.collectEimerTraces && meta.trace) {
|
|
98
|
+
meta.trace = this.tracer.startSpan(topic, { isEimerTrace: true, node: this.nodeId, component: 'Eimer', op: 'publish' }, meta.trace);
|
|
99
|
+
}
|
|
100
|
+
this.messageBus.publish(new EimerMessage_1.EimerMessage(this.idGenerator.generateId(), this.nodeId, topic, payload, meta));
|
|
101
|
+
if (meta?.collectEimerTraces && meta.trace) {
|
|
102
|
+
this.tracer.endSpan(meta?.trace?.spanId);
|
|
103
|
+
}
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* Subscribe a handler function to a topic
|
|
@@ -102,7 +112,14 @@ class Eimer {
|
|
|
102
112
|
subscribe(topic, payloadHandler) {
|
|
103
113
|
this.logger.debug('Subscribing to topic', { topic });
|
|
104
114
|
const messageHandler = (message) => {
|
|
105
|
-
|
|
115
|
+
let trace = message.meta?.trace;
|
|
116
|
+
if (message.meta?.collectEimerTraces && trace) {
|
|
117
|
+
trace = this.tracer.startSpan(topic, { isEimerTrace: true, node: this.nodeId, component: 'Eimer', op: 'handlePayload' }, trace);
|
|
118
|
+
}
|
|
119
|
+
payloadHandler(message.payload, trace ? { ...message.meta, trace } : message.meta);
|
|
120
|
+
if (message.meta?.collectEimerTraces && trace) {
|
|
121
|
+
this.tracer.endSpan(trace.spanId);
|
|
122
|
+
}
|
|
106
123
|
};
|
|
107
124
|
// Get or create the topic's handler map
|
|
108
125
|
let topicHandlerMap = this.handlerMap.get(topic);
|
|
@@ -163,12 +180,13 @@ class Eimer {
|
|
|
163
180
|
}
|
|
164
181
|
/**
|
|
165
182
|
* Shutdown this Eimer instance
|
|
166
|
-
* Will reject all RPC requests that are still waiting for a response
|
|
167
|
-
* and shutdown the
|
|
183
|
+
* Will reject all RPC requests that are still waiting for a response,
|
|
184
|
+
* shutdown the MessageBus, and shutdown the Tracer
|
|
168
185
|
*/
|
|
169
186
|
shutdown() {
|
|
170
187
|
this.rpcManager.shutdown();
|
|
171
188
|
this.messageBus.shutdown();
|
|
189
|
+
this.tracer.shutdown();
|
|
172
190
|
}
|
|
173
191
|
}
|
|
174
192
|
exports.Eimer = Eimer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Eimer.js","sourceRoot":"","sources":["../../../src/eimer/Eimer.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAC9C,yCAAsC;AAEtC,uEAAoE;AACpE,uDAAoD;AACpD,oEAAiE;AACjE,4DAAyD;
|
|
1
|
+
{"version":3,"file":"Eimer.js","sourceRoot":"","sources":["../../../src/eimer/Eimer.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAC9C,yCAAsC;AAEtC,uEAAoE;AACpE,uDAAoD;AACpD,oEAAiE;AACjE,4DAAyD;AACzD,gEAA6D;AAkB7D;;;;;;;;;GASG;AACH,MAAa,KAAK;IAWd;;;;;OAKG;IACH,YAAY,MAAc,EAAE,OAAsB,EAAE,YAAgC;QAVpF,uEAAuE;QACvE,wDAAwD;QAChD,eAAU,GAAoD,IAAI,GAAG,EAAE,CAAC;QAS5E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,YAAY,EAAE,WAAW,IAAI,IAAI,mCAAgB,EAAE,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,IAAI,IAAI,yBAAW,CAAC,OAAO,EAAE,QAAQ,IAAI,mBAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3I,IAAI,CAAC,MAAM,GAAG,YAAY,EAAE,MAAM,IAAI,IAAI,iCAAe,EAAE,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,YAAY,EAAE,UAAU,IAAI,IAAI,iCAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,M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MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,QAAQ;QACJ,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;CAEJ;AApND,sBAoNC"}
|
|
@@ -2,6 +2,7 @@ import type { IdGenerator } from "./IdGenerator";
|
|
|
2
2
|
import type { Logger } from "./Logger";
|
|
3
3
|
import type { MessageBus } from "./MessageBus";
|
|
4
4
|
import type { RpcManager } from "./RpcManager";
|
|
5
|
+
import type { Tracer } from "./Tracer";
|
|
5
6
|
/**
|
|
6
7
|
* Base Interface for dependencies injected into constructors
|
|
7
8
|
*
|
|
@@ -13,5 +14,6 @@ export interface EimerDependencies {
|
|
|
13
14
|
messageBus?: MessageBus;
|
|
14
15
|
rpcManager?: RpcManager;
|
|
15
16
|
logger?: Logger;
|
|
17
|
+
tracer?: Tracer;
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=EimerDependencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EimerDependencies.d.ts","sourceRoot":"","sources":["../../../src/eimer/EimerDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"EimerDependencies.d.ts","sourceRoot":"","sources":["../../../src/eimer/EimerDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EimerDependencies.js","sourceRoot":"","sources":["../../../src/eimer/EimerDependencies.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"EimerDependencies.js","sourceRoot":"","sources":["../../../src/eimer/EimerDependencies.ts"],"names":[],"mappings":";;AAkBC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EimerMessageMeta } from './EimerMessageMeta';
|
|
1
2
|
import type { MagicMessageMarker } from './MagicMessageMarker';
|
|
2
3
|
import type { MessageId } from './MessageId';
|
|
3
4
|
import type { NodeId } from './NodeId';
|
|
@@ -12,14 +13,16 @@ export declare class EimerMessage implements StructuredCloneable {
|
|
|
12
13
|
readonly from: NodeId;
|
|
13
14
|
readonly topic: Topic;
|
|
14
15
|
readonly payload?: unknown;
|
|
16
|
+
readonly meta?: EimerMessageMeta | undefined;
|
|
15
17
|
/**
|
|
16
18
|
*
|
|
17
19
|
* @param id globally unique id of this message - for example generated by an `IdGenerator`
|
|
18
20
|
* @param from nodeId that sent this message
|
|
19
21
|
* @param topic topic this message was sent on
|
|
20
22
|
* @param payload optional payload
|
|
23
|
+
* @param meta optional metadata
|
|
21
24
|
*/
|
|
22
|
-
constructor(id: MessageId, from: NodeId, topic: Topic, payload?: unknown);
|
|
25
|
+
constructor(id: MessageId, from: NodeId, topic: Topic, payload?: unknown, meta?: EimerMessageMeta);
|
|
23
26
|
/**
|
|
24
27
|
* User-defined Type Guard to ensure the message is an Eimer Request
|
|
25
28
|
* Similar to `Array.isArray()`, this static method can be used to check if an object is an `EimerMessage`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EimerMessage.d.ts","sourceRoot":"","sources":["../../../src/eimer/EimerMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,qBAAa,YAAa,YAAW,mBAAmB;IAEpD,SAAgB,MAAM,EAAE,kBAAkB,CAAU;IACpD,SAAgB,EAAE,EAAE,SAAS,CAAC;IAC9B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EimerMessage.d.ts","sourceRoot":"","sources":["../../../src/eimer/EimerMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,qBAAa,YAAa,YAAW,mBAAmB;IAEpD,SAAgB,MAAM,EAAE,kBAAkB,CAAU;IACpD,SAAgB,EAAE,EAAE,SAAS,CAAC;IAC9B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClC,SAAgB,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAEpD;;;;;;;OAOG;gBAEC,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,OAAO,EACjB,IAAI,CAAC,EAAE,gBAAgB;IAS3B;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,YAAY;CAY/D"}
|
|
@@ -11,13 +11,15 @@ class EimerMessage {
|
|
|
11
11
|
* @param from nodeId that sent this message
|
|
12
12
|
* @param topic topic this message was sent on
|
|
13
13
|
* @param payload optional payload
|
|
14
|
+
* @param meta optional metadata
|
|
14
15
|
*/
|
|
15
|
-
constructor(id, from, topic, payload) {
|
|
16
|
+
constructor(id, from, topic, payload, meta) {
|
|
16
17
|
this.marker = 'EM.1';
|
|
17
18
|
this.id = id;
|
|
18
19
|
this.from = from;
|
|
19
20
|
this.topic = topic;
|
|
20
21
|
this.payload = payload;
|
|
22
|
+
this.meta = meta;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* User-defined Type Guard to ensure the message is an Eimer Request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EimerMessage.js","sourceRoot":"","sources":["../../../src/eimer/EimerMessage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"EimerMessage.js","sourceRoot":"","sources":["../../../src/eimer/EimerMessage.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,MAAa,YAAY;IASrB;;;;;;;OAOG;IACH,YACI,EAAa,EACb,IAAY,EACZ,KAAY,EACZ,OAAiB,EACjB,IAAuB;QApBX,WAAM,GAAuB,MAAM,CAAC;QAsBhD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAY;QAC9B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC3E,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;YAChG,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjDD,oCAiDC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TraceContext } from './TraceContext';
|
|
2
|
+
/**
|
|
3
|
+
* Eimer Message Metadata
|
|
4
|
+
*
|
|
5
|
+
* Metadata that can optionally be passed along with a message.
|
|
6
|
+
*/
|
|
7
|
+
export interface EimerMessageMeta {
|
|
8
|
+
/** optional trace context */
|
|
9
|
+
trace?: TraceContext;
|
|
10
|
+
/**
|
|
11
|
+
* set to true to collect traces from eimer-internals while routing this message
|
|
12
|
+
* `trace` must be set when `collectEimerTraces` is `true` because traces will
|
|
13
|
+
* be injected into the TraceContext
|
|
14
|
+
*/
|
|
15
|
+
collectEimerTraces?: boolean;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=EimerMessageMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EimerMessageMeta.d.ts","sourceRoot":"","sources":["../../../src/eimer/EimerMessageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EimerMessageMeta.js","sourceRoot":"","sources":["../../../src/eimer/EimerMessageMeta.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { EimerMessageMeta } from './EimerMessageMeta';
|
|
1
2
|
/**
|
|
2
3
|
* A Payload can be an arbitrary object sent through an Eimer "network"
|
|
3
4
|
*
|
|
4
5
|
* A Payload Handler is a function that is involved when a payload is received.
|
|
5
6
|
*/
|
|
6
|
-
export type PayloadHandler = (payload: unknown) => void;
|
|
7
|
+
export type PayloadHandler = (payload: unknown, meta?: EimerMessageMeta) => void;
|
|
7
8
|
//# sourceMappingURL=PayloadHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadHandler.d.ts","sourceRoot":"","sources":["../../../src/eimer/PayloadHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"PayloadHandler.d.ts","sourceRoot":"","sources":["../../../src/eimer/PayloadHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { EimerMessageMeta } from './EimerMessageMeta';
|
|
1
2
|
/**
|
|
2
3
|
* An RPC Handler is the implementation of an RPC method that is invoked
|
|
3
4
|
* whenever the RPC method is called.
|
|
4
5
|
*/
|
|
5
|
-
export type RpcHandler = (params?: unknown) => Promise<unknown>;
|
|
6
|
+
export type RpcHandler = (params?: unknown, meta?: EimerMessageMeta) => Promise<unknown>;
|
|
6
7
|
//# sourceMappingURL=RpcHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcHandler.d.ts","sourceRoot":"","sources":["../../../src/eimer/RpcHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"RpcHandler.d.ts","sourceRoot":"","sources":["../../../src/eimer/RpcHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EimerMessageMeta } from './EimerMessageMeta';
|
|
1
2
|
import type { RpcHandler } from './RpcHandler';
|
|
2
3
|
import type { RpcMethod } from './RpcMethod';
|
|
3
4
|
/**
|
|
@@ -31,9 +32,10 @@ export interface RpcManager {
|
|
|
31
32
|
* Will asynchronously return the response or throw an error
|
|
32
33
|
* @param method the method name
|
|
33
34
|
* @param params optional, arbitrary parameters/arguments passed to the handler
|
|
34
|
-
* @param
|
|
35
|
+
* @param timeoutMs optional timeout, in milliseconds, after which the call will reject
|
|
36
|
+
* @param meta optional metadata
|
|
35
37
|
*/
|
|
36
|
-
call<T>(method: RpcMethod, params?: unknown,
|
|
38
|
+
call<T>(method: RpcMethod, params?: unknown, timeoutMs?: number, meta?: EimerMessageMeta): Promise<T>;
|
|
37
39
|
/**
|
|
38
40
|
* Unregister an RPC handler
|
|
39
41
|
* @param method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcManager.d.ts","sourceRoot":"","sources":["../../../src/eimer/RpcManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IAEvB;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAE9D
|
|
1
|
+
{"version":3,"file":"RpcManager.d.ts","sourceRoot":"","sources":["../../../src/eimer/RpcManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,UAAU;IAEvB;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAE9D;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEtG;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IAE3C;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trace Context
|
|
3
|
+
*
|
|
4
|
+
* Identifies a span within a distributed trace.
|
|
5
|
+
* Property names mirror W3C Trace Context / OpenTelemetry:
|
|
6
|
+
* A "trace" instruments a high-level operation and consists of
|
|
7
|
+
* multiple "spans", which can form a tree under the trace.
|
|
8
|
+
*/
|
|
9
|
+
export interface TraceContext {
|
|
10
|
+
traceId: string;
|
|
11
|
+
spanId: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=TraceContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceContext.d.ts","sourceRoot":"","sources":["../../../src/eimer/TraceContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceContext.js","sourceRoot":"","sources":["../../../src/eimer/TraceContext.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single completed span, local to the node that recorded it.
|
|
3
|
+
* Kept as generic as possible and shaped like the spans of Perfetto / OpenTelemetry
|
|
4
|
+
*/
|
|
5
|
+
export interface TraceSpan {
|
|
6
|
+
traceId: string;
|
|
7
|
+
spanId: string;
|
|
8
|
+
parentSpanId?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
startedAt: number;
|
|
12
|
+
durationMs: number;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=TraceSpan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceSpan.d.ts","sourceRoot":"","sources":["../../../src/eimer/TraceSpan.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceSpan.js","sourceRoot":"","sources":["../../../src/eimer/TraceSpan.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TraceContext } from './TraceContext';
|
|
2
|
+
import type { TracerBackend } from './TracerBackend';
|
|
3
|
+
/**
|
|
4
|
+
* Tracer Interface
|
|
5
|
+
*
|
|
6
|
+
* Defines an object Eimer interacts with to measure execution time of internal operations
|
|
7
|
+
*
|
|
8
|
+
* The collected tracing information is handed to a "TracerBackend" for storage and/or processing
|
|
9
|
+
*/
|
|
10
|
+
export interface Tracer {
|
|
11
|
+
/** Attach (or replace) the `TracerBackend` this `Tracer` forwards spans to. */
|
|
12
|
+
setBackend(backend: TracerBackend): void;
|
|
13
|
+
/**
|
|
14
|
+
* Start a fresh trace from scratch or append a new span to an existing parent trace
|
|
15
|
+
* if parent is undefined - creates a new traceId + spanId
|
|
16
|
+
* if parent is defined - reuses traceId and creates a new span with the correct parent
|
|
17
|
+
* @param name free-form span name (e.g. an RPC method or topic)
|
|
18
|
+
* @param metadata free-form, e.g. `{ node, component, op }`
|
|
19
|
+
* @param parent parent trace context - if set, the new trace becomes a sub-trace of the parent
|
|
20
|
+
*/
|
|
21
|
+
startSpan(name: string, metadata?: Record<string, unknown>, parent?: TraceContext): TraceContext;
|
|
22
|
+
/**
|
|
23
|
+
* Ends the span identified by `spanId` and forwards it to the configured `TracerBackend`
|
|
24
|
+
* @param spanId traceId - if undefined or unknown id, "endSpan" does nothing
|
|
25
|
+
* @param metadata merged into the span's metadata at close
|
|
26
|
+
*/
|
|
27
|
+
endSpan(spanId?: string, additionalMetadata?: Record<string, unknown>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Releases any resources held by this `Tracer`.
|
|
30
|
+
* Also calls shutdown on the TracerBackend
|
|
31
|
+
*/
|
|
32
|
+
shutdown(): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=Tracer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tracer.d.ts","sourceRoot":"","sources":["../../../src/eimer/Tracer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACnB,+EAA+E;IAC/E,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAEzC;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IAEjG;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE7E;;;OAGG;IACH,QAAQ,IAAI,IAAI,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tracer.js","sourceRoot":"","sources":["../../../src/eimer/Tracer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TraceSpan } from './TraceSpan';
|
|
2
|
+
/**
|
|
3
|
+
* TracerBackend Interface
|
|
4
|
+
*
|
|
5
|
+
* Defines an object used by a `Tracer` to store or process `TraceSpan`s
|
|
6
|
+
*/
|
|
7
|
+
export interface TracerBackend {
|
|
8
|
+
/**
|
|
9
|
+
* handle a new span
|
|
10
|
+
* called by `Tracer` whenever a span has "ended".
|
|
11
|
+
* Should process or store or forward the span.
|
|
12
|
+
* @param span
|
|
13
|
+
*/
|
|
14
|
+
handleSpan(span: TraceSpan): void;
|
|
15
|
+
/**
|
|
16
|
+
* Shutdown this backend.
|
|
17
|
+
* Should release resources or persist traces to storage etc.
|
|
18
|
+
*/
|
|
19
|
+
shutdown?(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=TracerBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracerBackend.d.ts","sourceRoot":"","sources":["../../../src/eimer/TracerBackend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracerBackend.js","sourceRoot":"","sources":["../../../src/eimer/TracerBackend.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './Eimer';
|
|
2
2
|
export * from './EimerDependencies';
|
|
3
3
|
export * from './EimerMessage';
|
|
4
|
+
export * from './EimerMessageMeta';
|
|
4
5
|
export * from './EimerOptions';
|
|
5
6
|
export * from './IdGenerator';
|
|
6
7
|
export * from './Logger';
|
|
@@ -16,5 +17,9 @@ export * from './RpcManager';
|
|
|
16
17
|
export * from './RpcMethod';
|
|
17
18
|
export * from './StructuredCloneable';
|
|
18
19
|
export * from './Topic';
|
|
20
|
+
export * from './TraceContext';
|
|
21
|
+
export * from './Tracer';
|
|
22
|
+
export * from './TracerBackend';
|
|
23
|
+
export * from './TraceSpan';
|
|
19
24
|
export * from './Transport';
|
|
20
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eimer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eimer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
package/dist/cjs/eimer/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./Eimer"), exports);
|
|
18
18
|
__exportStar(require("./EimerDependencies"), exports);
|
|
19
19
|
__exportStar(require("./EimerMessage"), exports);
|
|
20
|
+
__exportStar(require("./EimerMessageMeta"), exports);
|
|
20
21
|
__exportStar(require("./EimerOptions"), exports);
|
|
21
22
|
__exportStar(require("./IdGenerator"), exports);
|
|
22
23
|
__exportStar(require("./Logger"), exports);
|
|
@@ -32,5 +33,9 @@ __exportStar(require("./RpcManager"), exports);
|
|
|
32
33
|
__exportStar(require("./RpcMethod"), exports);
|
|
33
34
|
__exportStar(require("./StructuredCloneable"), exports);
|
|
34
35
|
__exportStar(require("./Topic"), exports);
|
|
36
|
+
__exportStar(require("./TraceContext"), exports);
|
|
37
|
+
__exportStar(require("./Tracer"), exports);
|
|
38
|
+
__exportStar(require("./TracerBackend"), exports);
|
|
39
|
+
__exportStar(require("./TraceSpan"), exports);
|
|
35
40
|
__exportStar(require("./Transport"), exports);
|
|
36
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eimer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,sDAAoC;AACpC,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,6CAA2B;AAC3B,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,8CAA4B;AAC5B,2CAAyB;AACzB,mDAAiC;AACjC,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,wDAAsC;AACtC,0CAAwB;AACxB,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/eimer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,6CAA2B;AAC3B,uDAAqC;AACrC,+CAA6B;AAC7B,mDAAiC;AACjC,8CAA4B;AAC5B,2CAAyB;AACzB,mDAAiC;AACjC,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,wDAAsC;AACtC,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B"}
|