sync-rpc

WebJar for sync-rpc

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

sync-rpc
Last Version

Last Version

1.3.6
Release Date

Release Date

Type

Type

jar
Description

Description

sync-rpc
WebJar for sync-rpc
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/ForbesLindesay/sync-rpc

Download sync-rpc

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/sync-rpc/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>sync-rpc</artifactId>
    <version>1.3.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/sync-rpc/
implementation 'org.webjars.npm:sync-rpc:1.3.6'
// https://jarcasting.com/artifacts/org.webjars.npm/sync-rpc/
implementation ("org.webjars.npm:sync-rpc:1.3.6")
'org.webjars.npm:sync-rpc:jar:1.3.6'
<dependency org="org.webjars.npm" name="sync-rpc" rev="1.3.6">
  <artifact name="sync-rpc" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='sync-rpc', version='1.3.6')
)
libraryDependencies += "org.webjars.npm" % "sync-rpc" % "1.3.6"
[org.webjars.npm/sync-rpc "1.3.6"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : get-port jar [3.1.0,4)

Project Modules

There are no modules declared in this project.

sync-rpc

Run asynchronous commands synchronously by putting them in a separate process

Build Status Dependency Status NPM version

Installation

npm install sync-rpc --save

Usage

worker.js

function init(connection) {
  // you can setup any connections you need here
  return function (message) {
    // Note how even though we return a promise, the resulting rpc client will be synchronous
    return Promise.resolve('sent ' + message + ' to ' + connection);
  }
}
module.exports = init;
const assert = require('assert');
const rpc = require('sync-rpc');

const client = rpc(__dirname + '/../test-worker.js', 'My Server');

const result = client('My Message');

assert(result === 'sent My Message to My Server');

License

MIT

Versions

Version
1.3.6