Socket
Socket
Sign inDemoInstall

@akiroz/pubsub-rpc

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@akiroz/pubsub-rpc

![test](https://github.com/akiroz/pubsub-rpc/workflows/test/badge.svg)


Version published
Weekly downloads
3
decreased by-78.57%
Maintainers
1
Weekly downloads
 
Created
Source

PubSub RPC

test

A generic RPC mechanism for Pub/Sub transports based on MsgPack

Supports NodeJS and modern browsers.

Why not JSON-RPC?

Native binary support for passing large binary payloads.

Mechanism

  1. Callee subscribe to topic
  2. Caller subscribe to topic/${base64(id)}
  3. Caller publish to topic with a binary id (default 16 byte) in the payload
  4. Callee calls RPC handler with params in the payload to get result or error response
  5. Callee publish response to topic/${base64(id)}
  6. Caller unsubscribe from topic/${base64(id)}

API

await register(pubSubClient, topic, async (params, topic) => {
    return result;
});

const result = await call(pubSubClient, topic, params);

FAQs

Package last updated on 14 May 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc