New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

simple-rpc-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-rpc-client

Simple RPC client based on rabbitmq (amqp)

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

simple-rpc-client

Simple RPC client module based on AMQP/RabbitMQ.

## Example

var simplerpc = require('./lib/simple-rpc');

var RABBITMQ_URL = 'amqp://guest:guest@localhost:5672';

simplerpc.connect(RABBITMQ_URL, function connected(err) {
    var remoteMethod = 'sum';
    var args = {
        a: 2,
        b: 3
    };

    simplerpc.call(remoteMethod, args, function callback(err, message) {
        logger.debug('got response', message);
    });
});

Timeouts

There is a 60-second timeout by default. You can pass any timeout you want to call. Once the timeout is reached, the callback will be called with an error.

    ...
    var TIMEOUT = 5000; // 5-second timeout
    simplerpc.call(slowRemoteMethod, args, TIMEOUT, function callback(err, message) {
        if (err) {
            // possible timeout
        } else {
            logger.debug('got response', message);
        }
    });

Development documentation

Coding guidelines

Uses provided .jshintrc and .gjslintrc flag files. To check source code style, type

grunt lint

Testing

To run tests, type

grunt test

FAQs

Package last updated on 15 Nov 2017

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