J-RPC client for call to remote j-rpc servers
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.document
.gitignore
History.txt
LICENSE
README.md
Rakefile
VERSION
jrpc.gemspec

README.md

J-RPC

J-RPC is heavily based on original BERT-RPC ruby-gem. The main difference is encoding. Instead of BERT it uses JSON.

See the BERT-RPC specification at bert-rpc.org for understanding error-codes and other protos specifics.

This library currently only supports the following J-RPC features:

  • call requests
  • cast requests

Installation

$ gem install jrpc

Examples

Require the library and create a service:

require 'jrpc'
svc = JRPC::Service.new('localhost', 9999)

Make a call:

svc.call.calc.add(1, 2)
# => 3

The underlying BERT-RPC transaction of the above call is:

-> {call, calc, add, [1, 2]}
<- {reply, 3}

Make a cast:

svc.cast.stats.incr
# => nil

The underlying BERT-RPC transaction of the above cast is:

-> {cast, stats, incr, []}
<- {noreply}

Documentation

Creating a service:

# No timeout
svc = JRPC::Service.new('localhost', 9999)

# 10s socket read timeout, raises BERTRPC::ReadTimeoutError
svc = JRPC::Service.new('localhost', 9999, 10)

Copyright

See LICENSE for details.