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

protomux-rpc

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protomux-rpc - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

26

index.js

@@ -118,2 +118,4 @@ const EventEmitter = require('events')

if (request.timeout) clearTimeout(request.timeout)
if (error) request.reject(new Error(error))

@@ -134,2 +136,14 @@ else {

_ontimeout (id) {
const request = this._requests.get(id)
if (request === undefined) return
this._requests.delete(id)
request.reject(new Error('timeout exceeded'))
this._endMaybe()
}
get closed () {

@@ -169,3 +183,4 @@ return this._channel.closed

valueEncoding = this._defaultValueEncoding,
requestEncoding = valueEncoding
requestEncoding = valueEncoding,
timeout = -1
} = options

@@ -179,5 +194,8 @@

return new Promise((resolve, reject) => {
this._requests.set(id, { options, resolve, reject })
})
return new Promise((resolve, reject) => this._requests.set(id, {
options,
resolve,
reject,
timeout: timeout > 0 && setTimeout(this._ontimeout.bind(this, id), timeout)
}))
}

@@ -184,0 +202,0 @@

4

package.json
{
"name": "protomux-rpc",
"version": "1.3.1",
"version": "1.4.0",
"description": "RPC over Protomux channels",

@@ -17,3 +17,3 @@ "main": "index.js",

"author": "Kasper Isager Dalsgarð <kasper@funktionel.co>",
"license": "ISC",
"license": "Apache-2.0",
"bugs": {

@@ -20,0 +20,0 @@ "url": "https://github.com/holepunchto/protomux-rpc/issues"

@@ -96,4 +96,10 @@ # Protomux RPC

Options are the same as `rpc.respond()`.
Options are the same as `rpc.respond()` with the addition of:
```js
{
timeout: -1 // Optional request timeout in milliseconds
}
```
#### `rpc.event(method, value[, options])`

@@ -103,3 +109,3 @@

Options are the same as `rpc.request()`.
Options are the same as `rpc.respond()`.

@@ -158,2 +164,2 @@ #### `rpc.cork()`

ISC
Apache-2.0

Sorry, the diff of this file is not supported yet

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