funnel_http 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +11 -0
- data/Rakefile +3 -1
- data/benchmark/benchmark.rb +3 -3
- data/ext/funnel_http/go.mod +1 -1
- data/ext/funnel_http/go.sum +2 -0
- data/lib/funnel_http/version.rb +1 -1
- data/rbs_collection.lock.yaml +12 -4
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c83aef0664b9cea7f66a26b5ef09fd175a9c3ee84163d778b80dc57caab7ad60
|
4
|
+
data.tar.gz: 7086e25c3a318ae33b59e6524b05ea03ff32c742e242ddde32b449d5e9668dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81fd96f70a60b533d9dc41a41204544b8aa36e57e3464861a933dfc43632d55402543530f8f78e2ab7be9e600bd7f4d7ff6471816a2a01c6edb442eb1713d8b2
|
7
|
+
data.tar.gz: 97cfe3cd7a61a84772b1059b1100d4391439ea362bd27c090efb3264d4d63d0b21ea7e37b587a73db3a9363a3709e9d14f78edbb115ab95c814deb6eb3fa3343
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
|
-
[full changelog](http://github.com/sue445/funnel_http/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/funnel_http/compare/v0.2.0...main)
|
3
|
+
|
4
|
+
## [0.2.0](https://github.com/sue445/funnel_http/releases/tag/v0.2.0) - 2025-01-07
|
5
|
+
[full changelog](http://github.com/sue445/funnel_http/compare/v0.1.0...v0.2.0)
|
6
|
+
|
7
|
+
* Support Ruby 3.4
|
8
|
+
* https://github.com/sue445/funnel_http/pull/48
|
3
9
|
|
4
10
|
## [0.1.0](https://github.com/sue445/funnel_http/releases/tag/v0.1.0) - 2024-12-18
|
5
11
|
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# FunnelHttp
|
2
2
|
Perform HTTP requests in parallel
|
3
3
|
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/funnel_http.svg)](https://badge.fury.io/rb/funnel_http)
|
4
5
|
[![build](https://github.com/sue445/funnel_http/actions/workflows/build.yml/badge.svg)](https://github.com/sue445/funnel_http/actions/workflows/build.yml)
|
5
6
|
|
6
7
|
## Requirements
|
@@ -72,6 +73,16 @@ client.add_default_request_header("Authorization", "Bearer xxxxxx")
|
|
72
73
|
## API Reference
|
73
74
|
https://sue445.github.io/funnel_http/
|
74
75
|
|
76
|
+
## Performance
|
77
|
+
Depending on the case, `funnel_http` runs about 1.2x faster than pure-Ruby `Thread` :dash:
|
78
|
+
|
79
|
+
See [benchmark/](benchmark/)
|
80
|
+
|
81
|
+
### Why?
|
82
|
+
`funnel_http` uses [Go's goroutine](https://go.dev/tour/concurrency) for asynchronous processing of HTTP requests.
|
83
|
+
|
84
|
+
So this is faster than Ruby in many cases.
|
85
|
+
|
75
86
|
## Development
|
76
87
|
|
77
88
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/Rakefile
CHANGED
@@ -26,7 +26,9 @@ namespace :go do
|
|
26
26
|
sh "which golangci-lint" do |ok, _|
|
27
27
|
raise "golangci-lint isn't installed. See. https://golangci-lint.run/welcome/install/" unless ok
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
|
+
build_tag = GoGem::Util.ruby_minor_version_build_tag
|
31
|
+
sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag}"
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
data/benchmark/benchmark.rb
CHANGED
@@ -5,11 +5,11 @@ require "etc"
|
|
5
5
|
|
6
6
|
ROOT_DIR = File.expand_path("..", __dir__)
|
7
7
|
|
8
|
-
TEST_SERVER_URL = "http://localhost:8080/"
|
8
|
+
TEST_SERVER_URL = ENV.fetch("TEST_SERVER_URL") { "http://localhost:8080/" }
|
9
9
|
|
10
10
|
REQUEST_COUNT = 100
|
11
11
|
|
12
|
-
BENCHMARK_CONCURRENCY = ENV.fetch("BENCHMARK_CONCURRENCY") { 4 }
|
12
|
+
BENCHMARK_CONCURRENCY = (ENV.fetch("BENCHMARK_CONCURRENCY") { 4 }).to_i
|
13
13
|
|
14
14
|
# Build native extension before running benchmark
|
15
15
|
Dir.chdir(ROOT_DIR) do
|
@@ -32,7 +32,7 @@ def fetch_server
|
|
32
32
|
end
|
33
33
|
|
34
34
|
Benchmark.ips do |x|
|
35
|
-
x.config(warmup: 1, time: 2)
|
35
|
+
# x.config(warmup: 1, time: 2)
|
36
36
|
|
37
37
|
x.report("FunnelHttp::Client#perform") do
|
38
38
|
FunnelHttp::Client.new.perform(requests)
|
data/ext/funnel_http/go.mod
CHANGED
data/ext/funnel_http/go.sum
CHANGED
@@ -36,6 +36,8 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV
|
|
36
36
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
37
37
|
github.com/ruby-go-gem/go-gem-wrapper v0.5.1 h1:TFGH/eOJl0uYzYMwrcLbZxXNQiQbQjCq/VLXyRk1HRM=
|
38
38
|
github.com/ruby-go-gem/go-gem-wrapper v0.5.1/go.mod h1:k2k+LziSCMxNYP4J9/9v90xdU6zlU1DJpJDTU6oJhHE=
|
39
|
+
github.com/ruby-go-gem/go-gem-wrapper v0.6.0 h1:WFu2Cj/uzKAOemsrCo4P6vsdOgB5yesrrJtAqvLkAso=
|
40
|
+
github.com/ruby-go-gem/go-gem-wrapper v0.6.0/go.mod h1:k2k+LziSCMxNYP4J9/9v90xdU6zlU1DJpJDTU6oJhHE=
|
39
41
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
40
42
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
41
43
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
data/lib/funnel_http/version.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
@@ -14,7 +14,7 @@ gems:
|
|
14
14
|
source:
|
15
15
|
type: git
|
16
16
|
name: ruby/gem_rbs_collection
|
17
|
-
revision:
|
17
|
+
revision: 7ff8cf6ab2759cb1d0fb2ca8d6c1f8ccab2c605c
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
19
19
|
repo_dir: gems
|
20
20
|
- name: fileutils
|
@@ -29,12 +29,20 @@ gems:
|
|
29
29
|
version: '0'
|
30
30
|
source:
|
31
31
|
type: stdlib
|
32
|
+
- name: parallel
|
33
|
+
version: '1.20'
|
34
|
+
source:
|
35
|
+
type: git
|
36
|
+
name: ruby/gem_rbs_collection
|
37
|
+
revision: 7ff8cf6ab2759cb1d0fb2ca8d6c1f8ccab2c605c
|
38
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
39
|
+
repo_dir: gems
|
32
40
|
- name: rack
|
33
41
|
version: '2.2'
|
34
42
|
source:
|
35
43
|
type: git
|
36
44
|
name: ruby/gem_rbs_collection
|
37
|
-
revision:
|
45
|
+
revision: 7ff8cf6ab2759cb1d0fb2ca8d6c1f8ccab2c605c
|
38
46
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
39
47
|
repo_dir: gems
|
40
48
|
- name: rake
|
@@ -42,7 +50,7 @@ gems:
|
|
42
50
|
source:
|
43
51
|
type: git
|
44
52
|
name: ruby/gem_rbs_collection
|
45
|
-
revision:
|
53
|
+
revision: 7ff8cf6ab2759cb1d0fb2ca8d6c1f8ccab2c605c
|
46
54
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
47
55
|
repo_dir: gems
|
48
56
|
- name: sinatra
|
@@ -50,7 +58,7 @@ gems:
|
|
50
58
|
source:
|
51
59
|
type: git
|
52
60
|
name: ruby/gem_rbs_collection
|
53
|
-
revision:
|
61
|
+
revision: 7ff8cf6ab2759cb1d0fb2ca8d6c1f8ccab2c605c
|
54
62
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
55
63
|
repo_dir: gems
|
56
64
|
- name: stringio
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: funnel_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: go_gem
|
@@ -16,14 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
18
|
+
version: '0.6'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
25
|
+
version: '0.6'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: puma
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,7 +238,6 @@ metadata:
|
|
239
238
|
changelog_uri: https://github.com/sue445/funnel_http/blob/main/CHANGELOG.md
|
240
239
|
documentation_uri: https://sue445.github.io/funnel_http/
|
241
240
|
rubygems_mfa_required: 'true'
|
242
|
-
post_install_message:
|
243
241
|
rdoc_options: []
|
244
242
|
require_paths:
|
245
243
|
- lib
|
@@ -254,8 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
252
|
- !ruby/object:Gem::Version
|
255
253
|
version: '0'
|
256
254
|
requirements: []
|
257
|
-
rubygems_version: 3.
|
258
|
-
signing_key:
|
255
|
+
rubygems_version: 3.6.2
|
259
256
|
specification_version: 4
|
260
257
|
summary: Perform HTTP requests in parallel
|
261
258
|
test_files: []
|