ruby_skynet

Ruby Client for calling Skynet services. Will also implement the server side so that Skynet Services can be hosted in Ruby

Example

require 'rubygems'
require 'ruby_skynet'
RubySkynet::Client.connect('TutorialService') do |tutorial_service|
  p tutorial_service.call('AddOne', 'value' => 5)
end

For details on installing and running the Tutorial Service: https://github.com/bketelsen/skynet/wiki/Service-Tutorial

Logging

Since ruby_skynet uses SemanticLogger, trace level logging of all TCP/IP calls can be enabled as follows:

require 'rubygems'
require 'ruby_skynet'
SemanticLogger::Logger.default_level = :trace
SemanticLogger::Logger.appenders << SemanticLogger::Appender::File.new('skynet.log')

RubySkynet::Client.connect('TutorialService') do |tutorial_service|
  p tutorial_service.call('AddOne', 'value' => 5)
end

Architecture

ruby_skynet implements its own doozer client which has been tested against the doozer fork: https://github.com/4ad/doozerd. The doozer client uses the active ruby_protobuf project for marshaling data for communicating with doozer

Dependencies

Install

gem install ruby_skynet

Future

  • Implement Skynet Service in Ruby so that it can be called from Go lang, etc.
  • Immediately drop connections to a service on a host when that instance shuts down or stops. ( Doozer::Wait )
  • More intelligent selection of available Skynet services. For example nearest, or looking at load etc.

Development

Want to contribute to Ruby Skynet?

First clone the repo and run the tests:

git clone git://github.com/ClarityServices/ruby_skynet.git
cd ruby_skynet
ruby -S rake test

Feel free to submit an issue and we'll try to resolve it.

Contributing

Once you've made your great commits:

  1. Fork ruby_skynet
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create an Issue with a link to your branch
  5. That's it!

Meta

This project uses Semantic Versioning.

Authors

Reid Morrison :: [email protected] :: @reidmorrison

License

Copyright 2012 Clarity Services, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.