Sha256: 6e7589d19f78e006c4e48ea64423f523c6cc653dbc84a68822edf5dcf8242007

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# Allow examples to be run directly outside of the Gem
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'rubygems'
require 'ruby_skynet'

SemanticLogger.default_level = :info
SemanticLogger.add_appender(STDOUT)

# Just echo back any parameters received when the echo method is called
class EchoService
  include RubySkynet::Service

  skynet_name = "JoeService"

  # Methods implemented by this service
  # Must take a Hash as input
  # Must Return a Hash response or nil for no response
  def echo(params)
    params['echo'] = true
    params
  end
end

# Start the server
RubySkynet::Server.start

puts "Press enter to shutdown server"
gets

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_skynet-0.7.0 examples/echo_server.rb