Sha256: d55ea9cbf5898d66b9fc3e62fc4c8e8ae40d163ddfb26d7d8493193d1f73db88

Contents?: true

Size: 782 Bytes

Versions: 30

Compression:

Stored size: 782 Bytes

Contents

# Use the Marshal and Base64 coders with the HTTP transport.

$: << File.expand_path("../../../lib", __FILE__)
require 'asir_transport_http'
require 'asir_coder_base64'

require 'math_service'
MathService.send(:include, ASIR::Client)

port = 3001
begin
  t = ASIR::Transport::HTTP.new(:uri => "http://localhost:#{port}")
  t._log_enabled = true

  c = t.encoder = ASIR::Coder::# ???.new(:encoders => ???)
  c._log_enabled = true

  server_pid = Process.fork do
    t.setup_server!
    t.start_server!
  end
  sleep 1 # wait for server to start

  MathService.asir.transport = t
  MathService.asir.sum([1, 2, 3])

rescue Exception => err
  $stderr.puts "ERROR: #{err.inspect}\n#{err.backtrace * "\n"}"

ensure
  sleep 1 # wait for server to finish
  Process.kill(9, server_pid)
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
asir-1.2.11 hack_night/exercise/prob-7.rb
asir-1.2.10 hack_night/exercise/prob-7.rb
asir-1.2.9 hack_night/exercise/prob-7.rb
asir-1.2.8 hack_night/exercise/prob-7.rb
asir-1.2.7 hack_night/exercise/prob-7.rb
asir-1.2.6 hack_night/exercise/prob-7.rb
asir-1.2.5 hack_night/exercise/prob-7.rb
asir-1.2.3 hack_night/exercise/prob-7.rb
asir-1.2.2 hack_night/exercise/prob-7.rb
asir-1.2.1 hack_night/exercise/prob-7.rb
asir-1.2.0 hack_night/exercise/prob-7.rb
asir-1.1.12 hack_night/exercise/prob-7.rb
asir-1.1.11 hack_night/exercise/prob-7.rb
asir-1.1.10 hack_night/exercise/prob-7.rb
asir-1.1.9 hack_night/exercise/prob-7.rb
asir-1.1.8 hack_night/exercise/prob-7.rb
asir-1.1.7 hack_night/exercise/prob-7.rb
asir-1.1.6 hack_night/exercise/prob-7.rb
asir-1.1.5 hack_night/exercise/prob-7.rb
asir-1.1.4 hack_night/exercise/prob-7.rb