betta-rpc

0.1.0 • Public • Published

betta-rpc - lightweight redis rpc on nodejs

a lightweight RPC build on top of redis queues.

  • Tags: node.js

Installation

npm install betta-rpc

Usage

Server

var bettarpc = require('betta-rpc');
 
var server = new bettarpc.Server({
  host: 'localhost',
  port: 6379,
  namespace: 'chat_server',
})
 
server.serve({
  halo: function(say, reply){
    reply(null, say + ' wow');
  },
 
  bye: function(reply){
    reply(null, 'bye');
  }
});

Client

var bettarpc = require('betta-rpc');
 
var client = new bettarpc.Client({
    host: 'localhost',
    port: 6379,
    namespace: 'chat_server',
    timeout: 10
  });
 
  client.connect(function(err, c){
 
    c.invoke('halo', 'hi1', function(err, res){
      if(err){
        console.error(err);
      }
      else{
        console.log('resp:', res);
      }
    });
 
    c.invoke('bye');
  });
 

Readme

Keywords

none

Package Sidebar

Install

npm i betta-rpc

Weekly Downloads

3

Version

0.1.0

License

none

Last publish

Collaborators

  • syklevin