🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

pig-rpc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pig-rpc

simple rpc using [zeromq](http://zeromq.org/) and [pigato](https://github.com/prdn/pigato)

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

pig-rpc

simple rpc using zeromq and pigato

Prerequisites

You need to install zeromq. On OSX you can use homebrew:

> brew update
> brew install zeromq 

##Install

> npm install pig-rpc

Example

Broker

var pig = require('pig-rpc')('tcp://*:55555');

pig.broker(function () {
  console.log('Broker started.');
});

Worker

var pig = require('pig-rpc')('tcp://localhost:55555');

pig.handle('square', function (num, callback) {
  callback(Math.pow(num, 2));
});

Client

var pig = require('pig-rpc')('tcp://localhost:55555');

pig.call('square', 9, function (err, res) {
  console.log('The square of 9 is', res);
});

FAQs

Package last updated on 09 Apr 2015

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