return if @serverclass == Object
args = (File.basename(@interpreter) == "jruby" ? "-J-server" : "")
@pipe = IO.popen("#{@interpreter} #{args} #{File.dirname(__FILE__)}/server.rb #{@host} #{@port} #{@serverclass.name}", "r+")
+ Marshal.load(@pipe) # wait until the server has started
+ sleep 0.2 # give the server time to actually start spawning sockets
end
def shutdown
server = Server.new(args)
server.start
-sleep 0.2 # give the server time to start
-
args = { :num_processes => 40, :clients_per_process => 5, :host => HOST, :port => PORT }
args[:interpreter] = ENV['THRIFT_CLIENT_INTERPRETER'] || ENV['THRIFT_INTERPRETER'] || "ruby"
BenchmarkManager.new(args, server).run
const and const.split('::').inject(Object) { |k,c| k.const_get(c) }
end
+# let our host know that the interpreter has started
+# ideally we'd wait until the server was serving, but we don't have a hook for that
+Marshal.dump(:started, STDOUT)
+
host, port, serverklass = ARGV
Server.start_server(host, port.to_i, resolve_const(serverklass))