🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

mx-rpc

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mx-rpc

提供一个通过socket.io为通信方式的rpc调用机制

latest
npmnpm
Version
1.1.6
Version published
Weekly downloads
23
Maintainers
1
Weekly downloads
 
Created
Source

mx-rpc

介绍

{提供一个通过socket.io为通信方式的rpc调用机制}

软件架构

软件架构说明

安装教程

使用说明

import { RPCCenter,RPCRequest,RPCHandle } from "mx-rpc";
new RPCCenter(15001)

let request = new RPCRequest("test", 15001)
@RPCHandle.class("test", module)
class _ {
    @RPCHandle.init()
    init() {
        console.log("init")
    }

    @RPCHandle.route()
    @RPCHandle.paramRequired("age", "number", true)
    @RPCHandle.paramRequired("name", "string", true)
    async name(age: number, name: string) {
        console.log(age, typeof age)
        return "nihao"
    }
}

async function start(){
    await request.init();
    await RPCHandle.doInit("test", 15001);
    let result = await request.Call("111", "name","11","qaweq");
    console.log(result);
}

参与贡献

  • Fork 本仓库
  • 新建 Feat_xxx 分支
  • 提交代码
  • 新建 Pull Request

Keywords

rpc

FAQs

Package last updated on 16 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts