Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Mirror services execution is now threaded (with promises)
Browse files Browse the repository at this point in the history
  • Loading branch information
SGospodinov committed Jul 8, 2017
1 parent 44aab4d commit a5e4715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/active_storage/service/mirror_service.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "active_support/core_ext/module/delegation"
require "concurrent"

class ActiveStorage::Service::MirrorService < ActiveStorage::Service
attr_reader :services
Expand Down Expand Up @@ -26,9 +27,8 @@ def primary_service
end

def perform_across_services(method, *args)
# FIXME: Convert to be threaded
services.collect do |service|
service.public_send method, *args
end
Concurrent::Promise.execute { service.public_send method, *args }
end.map(&:value)
end
end

0 comments on commit a5e4715

Please sign in to comment.