Class: Nitra::Slave::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/nitra/slave.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



65
66
67
# File 'lib/nitra/slave.rb', line 65

def channel
  @channel
end

Instance Method Details

#runObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/nitra/slave.rb', line 67

def run
  @channel = Nitra::Channel.new($stdin, $stdout)

  response = @channel.read
  unless response && response["command"] == "configuration"
    puts "handshake failed"
    exit 1
  end

  @channel.write("command" => "connected")

  runner = Nitra::Runner.new(response["configuration"], channel, response["runner_id"])

  runner.run
end