smooth_operator 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -29,15 +29,15 @@ module SmoothOperator
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.make_synchronous_request(url, options)
|
32
|
-
|
33
|
-
remote_call =
|
32
|
+
hydra = ::Typhoeus::Hydra::hydra
|
33
|
+
remote_call = make_asynchronous_request(url, options, hydra)
|
34
34
|
|
35
|
-
request.on_complete do |response|
|
35
|
+
remote_call.request.on_complete do |response|
|
36
36
|
remote_call.raw_response = response
|
37
37
|
remote_call.response = remote_call.parsed_response
|
38
38
|
end
|
39
39
|
|
40
|
-
|
40
|
+
hydra.run
|
41
41
|
remote_call
|
42
42
|
end
|
43
43
|
|
@@ -12,7 +12,8 @@ module SmoothOperator
|
|
12
12
|
|
13
13
|
def make_the_call(http_verb, options, id, &block)
|
14
14
|
injected_hydra = options[:hydra]
|
15
|
-
|
15
|
+
hydra = injected_hydra || ::Typhoeus::Hydra::hydra
|
16
|
+
options[:hydra] = hydra
|
16
17
|
|
17
18
|
remote_call = @object_class.make_the_call(http_verb, id, options)
|
18
19
|
|
@@ -21,7 +22,7 @@ module SmoothOperator
|
|
21
22
|
yield(remote_call)
|
22
23
|
end
|
23
24
|
|
24
|
-
|
25
|
+
hydra.run if injected_hydra.blank?
|
25
26
|
|
26
27
|
remote_call
|
27
28
|
end
|