MCPcopy Create free account
hub / github.com/apache/arrow / start_web_server

Method start_web_server

ruby/red-arrow/test/test-table.rb:891–908  ·  view source on GitHub ↗
(path, data, content_type)

Source from the content-addressed store, hash-verified

889
890 sub_test_case("URI") do
891 def start_web_server(path, data, content_type)
892 http_server = WEBrick::HTTPServer.new(:Port => 0)
893 http_server.mount_proc(path) do |request, response|
894 response.body = data
895 response.content_type = content_type
896 end
897 http_server_thread = Thread.new do
898 http_server.start
899 end
900 begin
901 Timeout.timeout(1) do
902 yield(http_server[:Port])
903 end
904 ensure
905 http_server.shutdown
906 http_server_thread.join
907 end
908 end
909
910 data("Arrow File",
911 ["arrow", "application/vnd.apache.arrow.file"])

Callers

nothing calls this directly

Calls 5

content_typeMethod · 0.80
newMethod · 0.45
bodyMethod · 0.45
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected