Sha256: 7efd0b35788c33a8658736464a80d84c5eba9e86813dd8eb943bc357f456b628

Contents?: true

Size: 715 Bytes

Versions: 1

Compression:

Stored size: 715 Bytes

Contents

require 'rubygems'
require 'ruby_skynet'

# Log trace information to a log file
SemanticLogger::Logger.default_level = :trace
SemanticLogger::Logger.appenders << SemanticLogger::Appender::File.new('skynet.log')

# Specify Port and Hostname to listen for requests on
RubySkynet::Server.port = 2000
RubySkynet::Server.hostname = '127.0.0.1'

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

  # 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
  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.4.0.pre examples/echo_server.rb