concur 1.0.1 → 1.0.2
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.
- data/lib/concur.rb +3 -1
- data/lib/executor.rb +0 -31
- metadata +1 -1
data/lib/concur.rb
CHANGED
data/lib/executor.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'faraday'
|
2
1
|
require_relative 'runnable'
|
3
2
|
require_relative 'future'
|
4
3
|
|
@@ -25,36 +24,6 @@ module Concur
|
|
25
24
|
raise "execute() not implemented, this is an invalid implemention."
|
26
25
|
end
|
27
26
|
|
28
|
-
def http_request(params, &blk)
|
29
|
-
puts 'http_request is deprecated'
|
30
|
-
f = StandardFuture.new do
|
31
|
-
conn = Faraday.new(:url => params[:base_url]) do |builder|
|
32
|
-
# builder.use Faraday::Request::UrlEncoded # convert request params as "www-form-urlencoded"
|
33
|
-
# builder.use Faraday::Request::JSON # encode request params as json
|
34
|
-
# builder.use Faraday::Response::Logger # log the request to STDOUT
|
35
|
-
builder.use Faraday::Adapter::NetHttp # make http requests with Net::HTTP
|
36
|
-
#
|
37
|
-
# # or, use shortcuts:
|
38
|
-
# builder.request :url_encoded
|
39
|
-
# builder.request :json
|
40
|
-
# builder.response :logger
|
41
|
-
# builder.adapter :net_http
|
42
|
-
end
|
43
|
-
if params[:http_method] == :post
|
44
|
-
response = conn.post params[:path]
|
45
|
-
else
|
46
|
-
response = conn.get params[:path]
|
47
|
-
end
|
48
|
-
if block_given?
|
49
|
-
response = blk.call(response)
|
50
|
-
end
|
51
|
-
response
|
52
|
-
end
|
53
|
-
process(f)
|
54
|
-
f
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
27
|
def queue_size
|
59
28
|
0
|
60
29
|
end
|