diff --git a/lib/sprockets/manifest.rb b/lib/sprockets/manifest.rb index 8eda60e4e..6bb65e865 100644 --- a/lib/sprockets/manifest.rb +++ b/lib/sprockets/manifest.rb @@ -120,14 +120,14 @@ def find(*args, &block) return to_enum(__method__, *args) unless block_given? environment = self.environment.cached - promises = args.flatten.map do |path| - Concurrent::Promise.execute(executor: executor) do + futures = args.flatten.map do |path| + Concurrent::Promises.future_on(executor) do environment.find_all_linked_assets(path).to_a end end - promises.each do |promise| - promise.value!.each(&block) + futures.each do |future| + future.value!.each(&block) end nil @@ -188,15 +188,15 @@ def compile(*args) filenames << asset.filename - promise = nil + future = nil exporters_for_asset(asset) do |exporter| next if exporter.skip?(logger) - if promise.nil? - promise = Concurrent::Promise.new(executor: executor) { exporter.call } - concurrent_exporters << promise.execute + if future.nil? + future = Concurrent::Promises.future_on(executor) { exporter.call } + concurrent_exporters << future else - concurrent_exporters << promise.then { exporter.call } + concurrent_exporters << future.then { exporter.call } end end end diff --git a/sprockets.gemspec b/sprockets.gemspec index b3e0ec923..dbc861ec6 100644 --- a/sprockets.gemspec +++ b/sprockets.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.executables = ["sprockets"] s.add_dependency "rack", ">= 2.2.4", "< 4" - s.add_dependency "concurrent-ruby", "~> 1.0" + s.add_dependency "concurrent-ruby", "~> 1.1" s.add_development_dependency "m", ">= 0" s.add_development_dependency "babel-transpiler", "~> 0.6"