# axon-rpc-call

> service rpc call

Latest version **1.0.3** (published 2020-12-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install axon-rpc-call
pnpm add axon-rpc-call
yarn add axon-rpc-call
bun add axon-rpc-call
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-12-24 |
| First published | 2020-12-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | weihongjie |
| Maintainers | weihongjie |
| Keywords | rpc |

## Links

- npm: https://www.npmjs.com/package/axon-rpc-call
- npm.io page: https://npm.io/package/axon-rpc-call

## Recent versions

- 1.0.3 (latest) — 2020-12-24
- 1.0.2 — 2020-12-24
- 1.0.0 — 2020-12-24

## README

### service point need env
> XC_REG_CENTER_REDIS_URL redis://:@127.0.0.1:6379/1
>
> roomHttpService 192.168.0.244 8100 8100
>
> [serviceName ,serviceIP, listenPort, servicePort]
> 
>

### client point need env
> XC_REG_CENTER_REDIS_URL redis://:@127.0.0.1:6379/1


```js
const XCRPC = require("./index")
const axonDebug = require('debug')('axon_debug_run')

let rep = new XCRPC.Responder({name: "myS1"})

rep.on("/user/query", (req, reply) => {
    axonDebug("req", "/user/query")
    req.query.uid = req.query.uid + 1
    setTimeout(() => {
        reply(null, req)
        axonDebug("__________")
    }, 1000 * 1)

})
let i = 0;
setInterval(async () => {
    let req = new XCRPC.Requester({name: "myS1"})
    req.send({
        type: "/user/query",
        query: {
            uid: i++
        }
    }, (err, result) => {
        axonDebug(`请求结果`, err, result)
    })
    let result = await req.send({
        type: "/user/query",
        query: {
            uid: i++
        }
    })
    axonDebug(`promise 请求结果`, result)
}, 5000)

```

---
_Source: https://npm.io/package/axon-rpc-call · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
