@query-farm/vgi-rpc 0.2.0 → 0.2.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/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# vgi-rpc
|
|
2
2
|
|
|
3
|
-
TypeScript server library for the [vgi-rpc](https://
|
|
3
|
+
TypeScript server library for the [vgi-rpc](https://vgi-rpc.query.farm) framework. Implements RPC servers that communicate over stdin/stdout using [Apache Arrow](https://arrow.apache.org/) IPC serialization.
|
|
4
4
|
|
|
5
5
|
Define RPC methods with Arrow-typed schemas, serve them over stdin/stdout, and interact with them using the Python `vgi-rpc` CLI or any vgi-rpc client. Unlike JSON-over-HTTP, structured data stays in Arrow columnar format for efficient transfer.
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ Define RPC methods with Arrow-typed schemas, serve them over stdin/stdout, and i
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
bun add vgi-rpc
|
|
21
|
+
bun add @query-farm/vgi-rpc
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Requires [Bun](https://bun.sh/) runtime.
|
|
@@ -26,7 +26,7 @@ Requires [Bun](https://bun.sh/) runtime.
|
|
|
26
26
|
## Quick Start
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
|
-
import { Protocol, VgiRpcServer, str, float } from "vgi-rpc";
|
|
29
|
+
import { Protocol, VgiRpcServer, str, float } from "@query-farm/vgi-rpc";
|
|
30
30
|
|
|
31
31
|
const protocol = new Protocol("Calculator");
|
|
32
32
|
|
|
@@ -53,7 +53,7 @@ server.run();
|
|
|
53
53
|
Connect to any vgi-rpc server programmatically:
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
|
-
import { httpConnect, subprocessConnect } from "vgi-rpc";
|
|
56
|
+
import { httpConnect, subprocessConnect } from "@query-farm/vgi-rpc";
|
|
57
57
|
|
|
58
58
|
// HTTP transport
|
|
59
59
|
const client = httpConnect("http://localhost:8080");
|
|
@@ -180,7 +180,7 @@ protocol.producer<{ count: number; current: number }>("produce_with_header", {
|
|
|
180
180
|
Declare schemas using convenient type singletons instead of manual `Schema`/`Field` construction:
|
|
181
181
|
|
|
182
182
|
```typescript
|
|
183
|
-
import { str, bytes, int, int32, float, float32, bool } from "vgi-rpc";
|
|
183
|
+
import { str, bytes, int, int32, float, float32, bool } from "@query-farm/vgi-rpc";
|
|
184
184
|
|
|
185
185
|
// Shorthand
|
|
186
186
|
protocol.unary("echo", {
|
|
@@ -275,7 +275,7 @@ Errors are transmitted as zero-row Arrow batches with `EXCEPTION`-level metadata
|
|
|
275
275
|
|
|
276
276
|
## Testing with the Python CLI
|
|
277
277
|
|
|
278
|
-
The [vgi-rpc CLI](https://github.com/
|
|
278
|
+
The [vgi-rpc CLI](https://github.com/Query-farm/vgi-rpc-python) can introspect and call methods on any TypeScript server:
|
|
279
279
|
|
|
280
280
|
```bash
|
|
281
281
|
pip install vgi-rpc[cli]
|
|
@@ -295,7 +295,7 @@ vgi-rpc --cmd "bun run examples/streaming.ts" call scale factor=2.0
|
|
|
295
295
|
|
|
296
296
|
## Wire Protocol Compatibility
|
|
297
297
|
|
|
298
|
-
This library implements the same wire protocol as the Python [vgi-rpc](https://github.com/
|
|
298
|
+
This library implements the same wire protocol as the Python [vgi-rpc](https://github.com/Query-farm/vgi-rpc-python) framework:
|
|
299
299
|
|
|
300
300
|
- Multiple sequential Arrow IPC streams on stdin/stdout
|
|
301
301
|
- Request batches carry method name and version in batch metadata
|
|
@@ -303,7 +303,7 @@ This library implements the same wire protocol as the Python [vgi-rpc](https://g
|
|
|
303
303
|
- Zero-row batches for log messages and errors
|
|
304
304
|
- `__describe__` introspection method for cross-language service discovery
|
|
305
305
|
|
|
306
|
-
See the
|
|
306
|
+
See the [Wire Protocol Specification](https://vgi-rpc.query.farm/wire-protocol) for the full protocol details.
|
|
307
307
|
|
|
308
308
|
## Examples
|
|
309
309
|
|