Socket
Socket
Sign inDemoInstall

redpack

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redpack

Simple Scalable RPC using Redis & BSON


Version published
Weekly downloads
7
increased by250%
Maintainers
0
Weekly downloads
 
Created
Source

RedPack - Easily Scalable RPC

Super simple RPC using a slightly modified form of MsgPack-RPC & BSON, on top of Redis queues. Currently supports NodeJS, Ruby, and Java.

NodeJS examples

npm install redpack

Server:

s = new rpc.Server('my_queue_name', {
  echo: function(amount) {
    return "from node server: " + (amount + 10);
  }
});
s.start();

Client:

c = new rpc.Client('my_queue_name');
c.invoke('echo', [12], function(err, result) {
  console.log("result is: "+result);
});

Ruby examples:

gem install redpack

Server:

class ExampleService
  def echo(amount)
    puts "called add_amount"
    return "from ruby: #{amount + 2}"
  end
end

server = RedPack::Server.new("my_queue_name", ExampleService.new)
server.start()

Client:

client = RedPack::Client.new("my_queue_name")

puts "making the method call asynchronously"
client.echo_async(23) do |error, result|
  puts "async result:"
  p result
end

Java examples:

Server:

public class EchoService implements Service {
  public Object execute(Object... params) throws ServiceException {
	  System.out.println("in echo");
    return "echo!";
  }
}

RPCServer server = new RPCServer("my_queue_name");
server.registerService("echo", new EchoService());
server.start();

Client:

RPCClient client = new RPCClient("my_queue_name");
Object result = client.invoke("echo", "something from java");
System.out.println("result : "+result.toString());

Keywords

FAQs

Package last updated on 18 Jul 2011

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

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