parallel_http 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +9 -9
- data/lib/parallel_http.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGY2ODI4NDZmNzkzYWM0N2Y2Njk3YmU2MjE1YTI1NTY4YWZiODVlMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
MDBkZTllY2JkMTA4MjUzMzkzNmM2NDM0MjFiNGIzYWZmNzhjZWM2ZQ==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTVmMmNhMWZjYjQxNDQ0ZTkxNjJjMGM4Y2UwMjQwOTcwN2E5MjdiYTE5Mjdm
|
10
|
+
MGJiNjc1MDE2YTc3MjU2Mjg4NWM1YmM0NWYwYmM1ZGFjMDZhNjdlNzUyN2Jh
|
11
|
+
OWU3MmU0YWI2NThmMzBmNzg4MGI4ODA4OThlMzAxM2UxNTYzNzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWYyNjUzYzE5OTg3ZmY2ZjU1Y2QxYWUzZjZjMjUwMDJkY2E4YmFmMmZhZDM2
|
14
|
+
OTBlNzQyNmM1NjlmNTc1MTc5NDdiNDk1YTJlMDExZDBmYWNmZWU0NTE4MzQx
|
15
|
+
OTVlZmQ1YjI2MjY0YTJjZjRlMGQ1NGQ2NTA2ZDhhZjBhZTgwMzM=
|
data/lib/parallel_http.rb
CHANGED
@@ -10,12 +10,14 @@ class ParallelHttp
|
|
10
10
|
def self.verbose!
|
11
11
|
@@verbose = true
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def self.exec requests, options={}
|
15
15
|
@@results = []
|
16
16
|
@@request_size = requests.size
|
17
17
|
if @@reactor_running
|
18
|
-
|
18
|
+
requests.each do |request|
|
19
|
+
ParallelHttp.single(request, options)
|
20
|
+
end
|
19
21
|
else
|
20
22
|
EM.run do
|
21
23
|
requests.each do |request|
|
@@ -29,7 +31,7 @@ class ParallelHttp
|
|
29
31
|
def self.add requests, options={}
|
30
32
|
requests.each do |request|
|
31
33
|
ParallelHttp.single(request, options)
|
32
|
-
end
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
def self.results
|
@@ -47,7 +49,7 @@ class ParallelHttp
|
|
47
49
|
hsh.merge!(:error => error) if error
|
48
50
|
@@results << hsh
|
49
51
|
if @@request_size == @@results.size && !@@reactor_running
|
50
|
-
EM.stop
|
52
|
+
EM.stop
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -66,4 +68,4 @@ class ParallelHttp
|
|
66
68
|
ParallelHttp.exec_result(request[:id], request[:url], h, h.error)
|
67
69
|
end
|
68
70
|
end
|
69
|
-
end
|
71
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodney Carvalho
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
66
|
rubyforge_project:
|
67
|
-
rubygems_version: 2.
|
67
|
+
rubygems_version: 2.2.2
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Parallel HTTP calls
|