@@ -29,6 +29,12 @@ Call remote functions as if they were local, with full TypeScript type safety an
2929
3030[ ** Quick Start** ] ( #-quick-start ) • [ ** Documentation** ] ( https://kunkunsh.github.io/kkrpc/ ) • [ ** Examples** ] ( #-examples ) • [ ** API Reference** ] ( https://jsr.io/@kunkun/kkrpc/doc ) • [ ** LLM Docs** ] ( https://docs.kkrpc.kunkun.sh/llms.txt ) • [ ** 中文文档** ] ( ./README.zh.md )
3131
32+ ## 🎥 Video Tutorial
33+
34+ [ ![ kkrpc Tutorial] ( https://img.youtube.com/vi/CF8lji8eB30/0.jpg )] ( https://youtu.be/CF8lji8eB30 )
35+
36+ Watch this video for a comprehensive introduction to kkrpc and how to use it in your projects.
37+
3238## 🤖 AI Support
3339
3440Working with kkrpc in your AI-powered editor? Add these skills to your Claude Code configuration to get intelligent assistance:
@@ -80,7 +86,7 @@ kkrpc stands out in the crowded RPC landscape by offering **true cross-runtime c
8086| ** ⚡ Zero Config** | No schema files or code generation required |
8187| ** 🔒 Data Validation** | Optional runtime validation with Zod, Valibot, ArkType, etc. |
8288| ** 🔌 Middleware** | Interceptor chain for logging, auth, timing, and more |
83- | ** ⏱️ Request Timeout** | Auto-reject pending calls after a configurable deadline |
89+ | ** ⏱️ Request Timeout** | Auto-reject pending calls after a configurable deadline |
8490| ** 🔁 Streaming** | Return ` AsyncIterable ` from methods, consume with ` for await ` |
8591| ** 🚀 Transferable Objects** | Zero-copy transfers for large data (40-100x faster) |
8692
@@ -302,7 +308,7 @@ Interceptors run **after** input validation and **before** output validation, so
302308kkrpc supports optional request timeouts to prevent pending calls from hanging forever if the remote side crashes or the transport drops:
303309
304310``` ts
305- import { RPCChannel , isRPCTimeoutError } from " kkrpc"
311+ import { isRPCTimeoutError , RPCChannel } from " kkrpc"
306312
307313const rpc = new RPCChannel (io , {
308314 expose: api ,
@@ -313,7 +319,7 @@ try {
313319 await api .slowOperation ()
314320} catch (error ) {
315321 if (isRPCTimeoutError (error )) {
316- console .log (error .method ) // "slowOperation"
322+ console .log (error .method ) // "slowOperation"
317323 console .log (error .timeoutMs ) // 5000
318324 }
319325}
@@ -1604,7 +1610,6 @@ bun test
16041610The benchmarks are designed to measure two key aspects of RPC performance:
16051611
160616121. ** Call Throughput** (` stdio-benchmark.test.ts` , ` websocket-benchmark.test.ts` )
1607-
16081613 - ** Sequential Operations** : Measures latency per call when making blocking calls one after another
16091614 - ** Concurrent Operations** : Measures throughput when making many calls in parallel using ` Promise.all`
16101615 - ** Batch Operations** : Tests batching multiple operations into a single RPC call
@@ -1684,7 +1689,7 @@ Results from running on a MacBook Pro (Apple Silicon):
16841689| ** Zero Config** | ✅ No code generation | ✅ No code generation | ✅ No code generation |
16851690| ** Callbacks** | ✅ Function parameters | ❌ No callbacks | ✅ Function parameters |
16861691| ** Data Validation** | ✅ Optional, any Standard Schema library | ✅ Built-in Zod support | ❌ Not supported |
1687- | ** Middleware** | ✅ Interceptor chain (onion model) | ✅ ` .use()` middleware | ❌ Not supported |
1692+ | ** Middleware** | ✅ Interceptor chain (onion model) | ✅ ` .use()` middleware | ❌ Not supported |
16881693| ** Request Timeout** | ✅ Per-channel timeout + destroy cleanup | ❌ Not built-in | ❌ Not supported |
16891694| ** Streaming** | ✅ AsyncIterable with cancel + error propagation | ✅ SSE subscriptions | ❌ Not supported |
16901695| ** Transferable Objects** | ✅ Zero-copy transfers (40-100x faster) | ❌ Not supported | ✅ Basic support |
0 commit comments