Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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)

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by83.33%
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.

Installing

$ yarn add @akiroz/pubsub-rpc

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

See tests for a basic use case that simply uses an EventEmitter as the Pub/Sub mechanism.

FAQs

Package last updated on 23 Sep 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

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