@synnaxlabs/client 0.17.2 → 0.17.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/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/client@0.17.
|
|
2
|
+
> @synnaxlabs/client@0.17.3 build /home/runner/work/synnax/synnax/client/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v5.1.2 [32mbuilding for production...[36m[39m
|
|
@@ -10,7 +10,7 @@ rendering chunks...
|
|
|
10
10
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
11
11
|
computing gzip size...
|
|
12
12
|
[2mdist/[22m[36mclient.js [39m[1m[33m531.80 kB[39m[22m[2m │ gzip: 116.94 kB[22m[2m │ map: 1,195.62 kB[22m
|
|
13
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
13
|
+
[32m[36m[vite:dts][32m Declaration files built in 3656ms.
|
|
14
14
|
[39m
|
|
15
15
|
[2mdist/[22m[36mclient.cjs [39m[1m[2m350.76 kB[22m[1m[22m[2m │ gzip: 92.53 kB[22m[2m │ map: 1,140.70 kB[22m
|
|
16
|
-
[32m✓ built in 5.
|
|
16
|
+
[32m✓ built in 5.18s[39m
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A client library for interacting with a Synnax cluster. It supports Typescript and can be used in both node and browser environments.
|
|
4
4
|
|
|
5
|
-
Detailed documentation is available [here](https://docs.synnaxlabs.com/typescript-client/get-started
|
|
5
|
+
Detailed documentation is available [here](https://docs.synnaxlabs.com/typescript-client/get-started).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Synnax, TimeStamp } from "@synnaxlabs/client";
|
|
2
|
+
|
|
3
|
+
// This example demonstrates how to stream live data from a channel in Synnax.
|
|
4
|
+
// Live-streaming is useful for real-time data processing and analysis, and is an
|
|
5
|
+
// integral part of Synnax's control sequence and data streaming capabilities.
|
|
6
|
+
|
|
7
|
+
// This example is meant to be used in conjunction with the stream_write.py example, and
|
|
8
|
+
// assumes that example is running in a separate terminal.
|
|
9
|
+
|
|
10
|
+
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
11
|
+
// are different, enter them here.
|
|
12
|
+
const client = new Synnax({
|
|
13
|
+
host: "localhost",
|
|
14
|
+
port: 9090,
|
|
15
|
+
username: "synnax",
|
|
16
|
+
password: "seldon",
|
|
17
|
+
secure: false
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// We can just specify the names of the channels we'd like to stream from.
|
|
21
|
+
const read_from = ["stream_write_example_time", "stream_write_example_data"]
|
|
22
|
+
|
|
23
|
+
const streamer = await client.telem.newStreamer(read_from);
|
|
24
|
+
|
|
25
|
+
// It's very important that we close the streamer when we're done with it to release
|
|
26
|
+
// network connections and other resources, so we wrap the streaming loop in a try-finally
|
|
27
|
+
// block.
|
|
28
|
+
try {
|
|
29
|
+
// Loop through the frames in the streamer. Each iteration will block until a new
|
|
30
|
+
// frame is available, and then we'll just print it out.
|
|
31
|
+
for await (const frame of streamer)
|
|
32
|
+
console.log({
|
|
33
|
+
time: new TimeStamp(frame.get("stream_write_example_time")[0].at(0)).toString(),
|
|
34
|
+
data: frame.get("stream_write_example_data")[0].at(0)
|
|
35
|
+
})
|
|
36
|
+
} finally {
|
|
37
|
+
streamer.close();
|
|
38
|
+
// Close the client when we're done with it.
|
|
39
|
+
client.close();
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@synnaxlabs/client": "^0.17.
|
|
12
|
+
"@synnaxlabs/client": "^0.17.2"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/@grpc/grpc-js": {
|
|
@@ -3653,9 +3653,9 @@
|
|
|
3653
3653
|
}
|
|
3654
3654
|
},
|
|
3655
3655
|
"node_modules/@synnaxlabs/client": {
|
|
3656
|
-
"version": "0.17.
|
|
3657
|
-
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.17.
|
|
3658
|
-
"integrity": "sha512-
|
|
3656
|
+
"version": "0.17.2",
|
|
3657
|
+
"resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.17.2.tgz",
|
|
3658
|
+
"integrity": "sha512-9r8C7KbWBHluBRnu8qw34hf+u8JW1CkM6VmAT+51N+m0z2AZA0pbK01MNNIjLQAZ1bAdKpzc57BxqSzCwIceGQ==",
|
|
3659
3659
|
"dependencies": {
|
|
3660
3660
|
"@synnaxlabs/freighter": "0.9.1",
|
|
3661
3661
|
"@synnaxlabs/x": "0.14.1",
|
|
@@ -58,7 +58,6 @@ try {
|
|
|
58
58
|
[timeChannel.key]: new Series({ data: new timeChannel.dataType.Array([timestamp]) }),
|
|
59
59
|
[dataChannel.key]: new Series({ data: new dataChannel.dataType.Array([data]) })
|
|
60
60
|
});
|
|
61
|
-
console.log(fr.columns);
|
|
62
61
|
await writer.write(fr);
|
|
63
62
|
|
|
64
63
|
if (i % 60 == 0)
|
package/package.json
CHANGED