Implement hrpc with streaming and wire into setup
- Add spec/hyperschema and spec/hrpc codegen (scripts/build-hrpc.js) with unary, request/response-stream, duplex, and send-only commands - Run build:hrpc and build:protomux from install.sh so setup is one-step - Native host: add attachHrpc (Protomux channel + generated HRPC), handlers for ping, streamSum, fetchStream, duplex, notify - Load HRPC lazily so missing spec does not crash host; use bare-stream for Duplex under Bare; add bare-stream, compact-encoding deps
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"version": 1,
|
||||
"schema": [
|
||||
{
|
||||
"name": "ping-request",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ping-response",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "pong",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stream-request-chunk",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "n",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "label",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stream-sum-response",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "sum",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "count",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fetch-request",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "count",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fetch-chunk",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "i",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "data",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "duplex-in",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "x",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "y",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "duplex-out",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "result",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "notify-request",
|
||||
"namespace": "bridgeswarm",
|
||||
"compact": false,
|
||||
"flagsPosition": 0,
|
||||
"fields": [
|
||||
{
|
||||
"name": "event",
|
||||
"type": "string",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"name": "payload",
|
||||
"type": "uint",
|
||||
"version": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user