← All procedures
server.call
Call a procedure on a remote peer through an outbound connection
CLI- Package
- @procedures/peer · README
- Path
["server","call"]- CLI
mark server call --path <string | string[]>- As data
{"$proc":["server","call"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/peer"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["server","call"], { path: "<path>" });
console.log(JSON.stringify(result));From the command line
$ mark server call --path <string | string[]>
As data, in a program
{ "$proc": ["server", "call"], "input": { "path": "<path>" } }Input
| Field | Type | Required | Default | Description |
|---|
connectionId | string | no | | The connection id from server connect |
address | string | no | | The address of a peer, for a one-time connection |
path | string | string[] | yes | | The procedure path on the peer: dot-separated text or a list |
input | any | no | | The input of the remote procedure |
Output
| Field | Type | Required | Default | Description |
|---|
result | any | yes | | The result of the remote procedure |
connectionId | string | yes | | The connection that the call used |
path | string[] | yes | | The path of the remote procedure |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"connectionId": {
"description": "The connection id from server connect",
"type": "string",
"minLength": 1
},
"address": {
"description": "The address of a peer, for a one-time connection",
"type": "string",
"minLength": 1
},
"path": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
],
"description": "The procedure path on the peer: dot-separated text or a list"
},
"input": {
"description": "The input of the remote procedure"
}
},
"required": [
"path"
]
},
"output": {
"type": "object",
"properties": {
"result": {
"description": "The result of the remote procedure"
},
"connectionId": {
"type": "string",
"description": "The connection that the call used"
},
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "The path of the remote procedure"
}
},
"required": [
"result",
"connectionId",
"path"
],
"additionalProperties": {}
}
}