Skip to content

Commit

Permalink
server: remove codes for async v1.x
Browse files Browse the repository at this point in the history
Signed-off-by: Shizuo Fujita <[email protected]>
  • Loading branch information
Watson1978 committed Jan 15, 2025
1 parent c2b09d4 commit e412f71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fluentd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency("test-unit", ["~> 3.3"])
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
gem.add_development_dependency("oj", [">= 2.14", "< 4"])
gem.add_development_dependency("async-http", ">= 0.50.0")
gem.add_development_dependency("async-http", "~> 0.86")
gem.add_development_dependency("aws-sigv4", ["~> 1.8"])
gem.add_development_dependency("aws-sdk-core", ["~> 3.191"])
gem.add_development_dependency("rexml", ["~> 3.2"])
Expand Down
18 changes: 4 additions & 14 deletions lib/fluent/plugin_helper/http_server/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,17 @@ def start(notify = nil)
notify.push(:ready)
end

if async_v2?
@server_task_queue = ::Thread::Queue.new
@server_task_queue.pop
@server_task&.stop
end
@server_task_queue = ::Thread::Queue.new
@server_task_queue.pop
@server_task&.stop
end

@logger.debug('Finished HTTP server')
end

def stop
@logger.debug('closing HTTP server')
if async_v2?
@server_task_queue&.push(:stop)
else
@server_task&.stop
end
@server_task_queue.push(:stop)
end

HttpServer::Methods::ALL.map { |e| e.downcase.to_sym }.each do |name|
Expand All @@ -100,10 +94,6 @@ def stop
@router.mount(name, path, app || block)
end
end

private def async_v2?
Gem::Version.new(Async::VERSION) >= Gem::Version.new('2.0')
end
end
end
end
Expand Down

0 comments on commit e412f71

Please sign in to comment.