lepus 0.0.1.beta2 → 0.0.1.rc2
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 +4 -4
- data/.github/workflows/linter.yml +21 -0
- data/.github/workflows/specs.yml +93 -13
- data/.gitignore +3 -0
- data/.rubocop.yml +10 -0
- data/.tool-versions +1 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +25 -9
- data/Makefile +19 -0
- data/README.md +383 -7
- data/bin/setup +5 -2
- data/docker-compose.yml +5 -3
- data/gemfiles/{rails52.gemfile → Gemfile.rails-5.2} +1 -0
- data/gemfiles/{rails52.gemfile.lock → Gemfile.rails-5.2.lock} +82 -62
- data/gemfiles/{rails61.gemfile → Gemfile.rails-6.1} +1 -0
- data/gemfiles/{rails61.gemfile.lock → Gemfile.rails-6.1.lock} +84 -64
- data/gemfiles/Gemfile.rails-7.2 +5 -0
- data/gemfiles/Gemfile.rails-7.2.lock +314 -0
- data/gemfiles/Gemfile.rails-8.0 +5 -0
- data/gemfiles/Gemfile.rails-8.0.lock +315 -0
- data/lepus.gemspec +2 -0
- data/lib/lepus/cli.rb +11 -4
- data/lib/lepus/configuration.rb +65 -0
- data/lib/lepus/connection_pool.rb +135 -0
- data/lib/lepus/consumer.rb +49 -43
- data/lib/lepus/consumers/config.rb +183 -0
- data/lib/lepus/consumers/handler.rb +54 -0
- data/lib/lepus/consumers/middleware_chain.rb +22 -0
- data/lib/lepus/consumers/middlewares/exception_logger.rb +27 -0
- data/lib/lepus/consumers/middlewares/honeybadger.rb +33 -0
- data/lib/lepus/consumers/middlewares/json.rb +37 -0
- data/lib/lepus/consumers/middlewares/max_retry.rb +83 -0
- data/lib/lepus/consumers/middlewares/unique.rb +65 -0
- data/lib/lepus/consumers/worker.rb +140 -0
- data/lib/lepus/consumers/worker_factory.rb +124 -0
- data/lib/lepus/consumers.rb +6 -0
- data/lib/lepus/message/delivery_info.rb +72 -0
- data/lib/lepus/message/metadata.rb +99 -0
- data/lib/lepus/message.rb +88 -5
- data/lib/lepus/middleware_chain.rb +83 -0
- data/lib/lepus/primitive/hash.rb +29 -0
- data/lib/lepus/process.rb +21 -21
- data/lib/lepus/process_registry.rb +94 -22
- data/lib/lepus/processes/base.rb +0 -5
- data/lib/lepus/processes/callbacks.rb +3 -0
- data/lib/lepus/processes/interruptible.rb +4 -8
- data/lib/lepus/processes/procline.rb +1 -1
- data/lib/lepus/processes/registrable.rb +1 -1
- data/lib/lepus/processes/runnable.rb +1 -1
- data/lib/lepus/processes.rb +15 -0
- data/lib/lepus/producer.rb +141 -30
- data/lib/lepus/producers/config.rb +46 -0
- data/lib/lepus/producers/definition.rb +48 -0
- data/lib/lepus/producers/hooks.rb +170 -0
- data/lib/lepus/producers/middleware_chain.rb +22 -0
- data/lib/lepus/producers/middlewares/correlation_id.rb +37 -0
- data/lib/lepus/producers/middlewares/header.rb +47 -0
- data/lib/lepus/producers/middlewares/instrumentation.rb +30 -0
- data/lib/lepus/producers/middlewares/json.rb +47 -0
- data/lib/lepus/producers/middlewares/unique.rb +67 -0
- data/lib/lepus/producers.rb +7 -0
- data/lib/lepus/publisher.rb +65 -0
- data/lib/lepus/supervisor/children_pipes.rb +25 -0
- data/lib/lepus/supervisor/lifecycle_hooks.rb +50 -0
- data/lib/lepus/supervisor/pidfiled.rb +1 -1
- data/lib/lepus/supervisor/registry_cleaner.rb +22 -0
- data/lib/lepus/supervisor.rb +122 -25
- data/lib/lepus/testing/exchange.rb +95 -0
- data/lib/lepus/testing/message_builder.rb +177 -0
- data/lib/lepus/testing/rspec_matchers.rb +258 -0
- data/lib/lepus/testing.rb +210 -0
- data/lib/lepus/unique.rb +18 -0
- data/lib/lepus/version.rb +1 -1
- data/lib/lepus.rb +34 -28
- metadata +76 -15
- data/lib/lepus/consumer_config.rb +0 -149
- data/lib/lepus/consumer_wrapper.rb +0 -46
- data/lib/lepus/lifecycle_hooks.rb +0 -49
- data/lib/lepus/middlewares/honeybadger.rb +0 -23
- data/lib/lepus/middlewares/json.rb +0 -35
- data/lib/lepus/middlewares/max_retry.rb +0 -57
- data/lib/lepus/processes/consumer.rb +0 -113
- data/lib/lepus/supervisor/config.rb +0 -45
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2928402610a7a4f5027f33e31ea7ea790f645ebb9029e1aeba9c735681d803c
|
|
4
|
+
data.tar.gz: fab7a599c6e24140e523d215b54bb6aed06e1c40b4ee2263ffd8c26b6de726d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68c80bbe807bb05bd6ac3acafe8a534b70ce965190ffa19589ac2dc49e6bfae14399706c0516bb0eeb4f850b27e73dbb52ea2e16165f82d9b00615746f99dd7d
|
|
7
|
+
data.tar.gz: 8074660176b3f287a531ad9f8c73feb81b434da8fe7411d6e9b6a309e79474a6d0598b40d0439524b106733293b00b515ae7c74b4ffaf4c93e9ba3ad81000565
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Linter
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
rubocop:
|
|
11
|
+
name: "Rubocop"
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: "3.0"
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
- name: Run rubocop
|
|
20
|
+
run: |
|
|
21
|
+
bundle exec rubocop --parallel
|
data/.github/workflows/specs.yml
CHANGED
|
@@ -2,23 +2,93 @@ name: Specs
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [ main ]
|
|
6
6
|
pull_request:
|
|
7
|
-
branches: [
|
|
7
|
+
branches: [ main ]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
|
-
|
|
10
|
+
ruby-2-7:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
strategy:
|
|
13
13
|
fail-fast: false
|
|
14
14
|
matrix:
|
|
15
|
-
ruby:
|
|
15
|
+
ruby-version:
|
|
16
|
+
- "2.7"
|
|
16
17
|
gemfile:
|
|
17
18
|
- Gemfile
|
|
18
|
-
- gemfiles/
|
|
19
|
-
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
|
|
19
|
+
- gemfiles/Gemfile.rails-5.2
|
|
20
|
+
name: ${{ matrix.ruby-version }}-${{ matrix.gemfile }}
|
|
20
21
|
env:
|
|
21
22
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: ruby/setup-ruby@v1
|
|
26
|
+
with:
|
|
27
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
28
|
+
bundler-cache: true
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: bundle install --jobs 4 --retry 3
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: bundle exec rspec
|
|
33
|
+
|
|
34
|
+
ruby-3-0:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix:
|
|
39
|
+
ruby-version:
|
|
40
|
+
- "3.0"
|
|
41
|
+
- "3.1"
|
|
42
|
+
gemfile:
|
|
43
|
+
- Gemfile
|
|
44
|
+
- gemfiles/Gemfile.rails-6.1
|
|
45
|
+
|
|
46
|
+
name: ${{ matrix.ruby-version }}-${{ matrix.gemfile }}
|
|
47
|
+
env:
|
|
48
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
- uses: ruby/setup-ruby@v1
|
|
52
|
+
with:
|
|
53
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
54
|
+
bundler-cache: true
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: bundle install --jobs 4 --retry 3
|
|
57
|
+
- name: Run tests
|
|
58
|
+
run: bundle exec rspec
|
|
59
|
+
|
|
60
|
+
ruby-3-2:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
strategy:
|
|
63
|
+
fail-fast: false
|
|
64
|
+
matrix:
|
|
65
|
+
ruby-version:
|
|
66
|
+
- "3.2"
|
|
67
|
+
- "3.3"
|
|
68
|
+
- "3.4"
|
|
69
|
+
gemfile:
|
|
70
|
+
- gemfiles/Gemfile.rails-7.2
|
|
71
|
+
- gemfiles/Gemfile.rails-8.0
|
|
72
|
+
|
|
73
|
+
name: ${{ matrix.ruby-version }}-${{ matrix.gemfile }}
|
|
74
|
+
env:
|
|
75
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
76
|
+
steps:
|
|
77
|
+
- uses: actions/checkout@v4
|
|
78
|
+
- uses: ruby/setup-ruby@v1
|
|
79
|
+
with:
|
|
80
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
81
|
+
bundler-cache: true
|
|
82
|
+
- name: Install dependencies
|
|
83
|
+
run: bundle install --jobs 4 --retry 3
|
|
84
|
+
- name: Run tests
|
|
85
|
+
run: bundle exec rspec
|
|
86
|
+
|
|
87
|
+
integration:
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
name: integration-tests
|
|
90
|
+
env:
|
|
91
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile.rails-8.0
|
|
22
92
|
services:
|
|
23
93
|
rabbitmq:
|
|
24
94
|
image: rabbitmq:3-management
|
|
@@ -30,15 +100,25 @@ jobs:
|
|
|
30
100
|
ports:
|
|
31
101
|
- 5672:5672
|
|
32
102
|
- 15672:15672
|
|
103
|
+
redis:
|
|
104
|
+
image: redis:7-alpine
|
|
105
|
+
options: >-
|
|
106
|
+
--health-cmd "redis-cli ping"
|
|
107
|
+
--health-interval 10s
|
|
108
|
+
--health-timeout 5s
|
|
109
|
+
--health-retries 5
|
|
110
|
+
ports:
|
|
111
|
+
- 6379:6379
|
|
33
112
|
steps:
|
|
34
113
|
- uses: actions/checkout@v4
|
|
35
114
|
- uses: ruby/setup-ruby@v1
|
|
36
115
|
with:
|
|
37
|
-
ruby-version:
|
|
116
|
+
ruby-version: "3.4"
|
|
38
117
|
bundler-cache: true
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
118
|
+
- name: Install dependencies
|
|
119
|
+
run: bundle install --jobs 4 --retry 3
|
|
120
|
+
- name: Run integration tests
|
|
121
|
+
run: bundle exec rspec --tag integration
|
|
122
|
+
env:
|
|
123
|
+
RABBITMQ_URL: amqp://localhost:5672
|
|
124
|
+
REDIS_URL: redis://localhost:6379
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby 2
|
|
1
|
+
ruby 3.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
lepus (0.0.1.
|
|
4
|
+
lepus (0.0.1.rc2)
|
|
5
5
|
bunny
|
|
6
6
|
concurrent-ruby
|
|
7
7
|
multi_json
|
|
@@ -13,18 +13,23 @@ GEM
|
|
|
13
13
|
specs:
|
|
14
14
|
addressable (2.8.7)
|
|
15
15
|
public_suffix (>= 2.0.2, < 7.0)
|
|
16
|
-
amq-protocol (2.
|
|
16
|
+
amq-protocol (2.5.1)
|
|
17
17
|
ast (2.4.2)
|
|
18
18
|
bigdecimal (3.1.8)
|
|
19
|
-
bunny (2.
|
|
20
|
-
amq-protocol (~> 2.3
|
|
19
|
+
bunny (2.24.0)
|
|
20
|
+
amq-protocol (~> 2.3)
|
|
21
21
|
sorted_set (~> 1, >= 1.0.2)
|
|
22
22
|
coderay (1.1.3)
|
|
23
|
-
concurrent-ruby (1.3.
|
|
23
|
+
concurrent-ruby (1.3.6)
|
|
24
|
+
connection_pool (2.5.5)
|
|
24
25
|
crack (1.0.0)
|
|
25
26
|
bigdecimal
|
|
26
27
|
rexml
|
|
28
|
+
de-dupe (0.0.2)
|
|
29
|
+
redis
|
|
30
|
+
zeitwerk
|
|
27
31
|
diff-lcs (1.5.1)
|
|
32
|
+
docile (1.4.1)
|
|
28
33
|
dotenv (2.8.1)
|
|
29
34
|
hashdiff (1.1.1)
|
|
30
35
|
json (2.7.5)
|
|
@@ -43,6 +48,10 @@ GEM
|
|
|
43
48
|
racc (1.8.1)
|
|
44
49
|
rainbow (3.1.1)
|
|
45
50
|
rbtree (0.4.6)
|
|
51
|
+
redis (5.4.1)
|
|
52
|
+
redis-client (>= 0.22.0)
|
|
53
|
+
redis-client (0.27.0)
|
|
54
|
+
connection_pool
|
|
46
55
|
regexp_parser (2.9.2)
|
|
47
56
|
rexml (3.3.9)
|
|
48
57
|
rspec (3.13.0)
|
|
@@ -77,10 +86,14 @@ GEM
|
|
|
77
86
|
rubocop-rspec (3.2.0)
|
|
78
87
|
rubocop (~> 1.61)
|
|
79
88
|
ruby-progressbar (1.13.0)
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
simplecov (0.22.0)
|
|
90
|
+
docile (~> 1.1)
|
|
91
|
+
simplecov-html (~> 0.11)
|
|
92
|
+
simplecov_json_formatter (~> 0.1)
|
|
93
|
+
simplecov-html (0.13.2)
|
|
94
|
+
simplecov_json_formatter (0.1.4)
|
|
95
|
+
sorted_set (1.1.0)
|
|
82
96
|
rbtree
|
|
83
|
-
set (~> 1.0)
|
|
84
97
|
standard (1.37.0)
|
|
85
98
|
language_server-protocol (~> 3.17.0.2)
|
|
86
99
|
lint_roller (~> 1.0)
|
|
@@ -93,7 +106,7 @@ GEM
|
|
|
93
106
|
standard-performance (1.4.0)
|
|
94
107
|
lint_roller (~> 1.1)
|
|
95
108
|
rubocop-performance (~> 1.21.0)
|
|
96
|
-
thor (1.
|
|
109
|
+
thor (1.5.0)
|
|
97
110
|
unicode-display_width (2.6.0)
|
|
98
111
|
webmock (3.24.0)
|
|
99
112
|
addressable (>= 2.8.0)
|
|
@@ -106,6 +119,8 @@ PLATFORMS
|
|
|
106
119
|
x86_64-linux
|
|
107
120
|
|
|
108
121
|
DEPENDENCIES
|
|
122
|
+
connection_pool (< 3)
|
|
123
|
+
de-dupe
|
|
109
124
|
dotenv
|
|
110
125
|
lepus!
|
|
111
126
|
pry
|
|
@@ -113,6 +128,7 @@ DEPENDENCIES
|
|
|
113
128
|
rubocop
|
|
114
129
|
rubocop-performance
|
|
115
130
|
rubocop-rspec
|
|
131
|
+
simplecov
|
|
116
132
|
standard
|
|
117
133
|
webmock
|
|
118
134
|
|
data/Makefile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.PHONY: lock lock-conservative
|
|
2
|
+
|
|
3
|
+
DOCKER_RUN = docker run --rm -v "$(CURDIR)":/app -w /app
|
|
4
|
+
|
|
5
|
+
# Update all lockfiles (conservative - only add new gems, no upgrades)
|
|
6
|
+
lock-conservative:
|
|
7
|
+
$(DOCKER_RUN) ruby:2.7 bash -c "gem install bundler:2.3.22 && bundle lock --conservative"
|
|
8
|
+
$(DOCKER_RUN) ruby:2.7 bash -c "gem install bundler:2.3.22 && BUNDLE_GEMFILE=gemfiles/Gemfile.rails-5.2 bundle lock --conservative"
|
|
9
|
+
$(DOCKER_RUN) ruby:3.1 bash -c "BUNDLE_GEMFILE=gemfiles/Gemfile.rails-6.1 bundle lock --conservative"
|
|
10
|
+
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-7.2 bundle lock --conservative
|
|
11
|
+
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-8.0 bundle lock --conservative
|
|
12
|
+
|
|
13
|
+
# Update all lockfiles (full update - may upgrade gems)
|
|
14
|
+
lock:
|
|
15
|
+
$(DOCKER_RUN) ruby:2.7 bash -c "gem install bundler:2.3.22 && bundle lock --update"
|
|
16
|
+
$(DOCKER_RUN) ruby:2.7 bash -c "gem install bundler:2.3.22 && BUNDLE_GEMFILE=gemfiles/Gemfile.rails-5.2 bundle lock --update"
|
|
17
|
+
$(DOCKER_RUN) ruby:3.1 bash -c "BUNDLE_GEMFILE=gemfiles/Gemfile.rails-6.1 bundle lock --update"
|
|
18
|
+
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-7.2 bundle lock --update
|
|
19
|
+
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-8.0 bundle lock --update
|