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

Commit a5e4715

Browse files
committed
Mirror services execution is now threaded (with promises)
1 parent 44aab4d commit a5e4715

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/active_storage/service/mirror_service.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require "active_support/core_ext/module/delegation"
2+
require "concurrent"
23

34
class ActiveStorage::Service::MirrorService < ActiveStorage::Service
45
attr_reader :services
@@ -26,9 +27,8 @@ def primary_service
2627
end
2728

2829
def perform_across_services(method, *args)
29-
# FIXME: Convert to be threaded
3030
services.collect do |service|
31-
service.public_send method, *args
32-
end
31+
Concurrent::Promise.execute { service.public_send method, *args }
32+
end.map(&:value)
3333
end
3434
end

0 commit comments

Comments
 (0)