Barrister::Redis
A Redis server-container and transport for Barrister RPC.
Usage
To instantiate a Redis transport, you need only the URL of the Redis database and the name of the list that client and server will be using as a message bus:
list_name = 'foo_bar'
transport = Barrister::RedisTransport.new('redis://localhost:6379', list_name)
Instantiating a Redis container is easy as well, and follows a similar pattern:
json_path = './user_service.json'
database_url = 'redis://localhost:6379'
list_name = 'foo_bar'
handlers = [UserService]
container = Barrister::RedisContainer.new json_path, database_url, list_name, handlers
container.start
Calling the 'start' method of an instantiated RedisContainer will connect to the Redis database and begin polling for inbound messages.
Installation
Add this line to your application's Gemfile:
gem 'barrister-redis'
And then execute:
$ bundle
Or install it yourself as:
$ gem install barrister-redis
Contributing
- Fork it ( http://github.com/
/barrister-redis/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request