waterdrop 1.4.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.diffend.yml +3 -0
  5. data/.github/workflows/ci.yml +75 -0
  6. data/.gitignore +2 -0
  7. data/.ruby-version +1 -1
  8. data/CHANGELOG.md +13 -0
  9. data/Gemfile +9 -0
  10. data/Gemfile.lock +67 -54
  11. data/LICENSE +165 -0
  12. data/README.md +194 -56
  13. data/config/errors.yml +3 -16
  14. data/docker-compose.yml +17 -0
  15. data/lib/water_drop.rb +4 -24
  16. data/lib/water_drop/config.rb +41 -142
  17. data/lib/water_drop/contracts.rb +0 -2
  18. data/lib/water_drop/contracts/config.rb +8 -121
  19. data/lib/water_drop/contracts/message.rb +41 -0
  20. data/lib/water_drop/errors.rb +31 -5
  21. data/lib/water_drop/instrumentation.rb +7 -0
  22. data/lib/water_drop/instrumentation/monitor.rb +16 -23
  23. data/lib/water_drop/instrumentation/stdout_listener.rb +113 -32
  24. data/lib/water_drop/producer.rb +143 -0
  25. data/lib/water_drop/producer/async.rb +51 -0
  26. data/lib/water_drop/producer/buffer.rb +113 -0
  27. data/lib/water_drop/producer/builder.rb +63 -0
  28. data/lib/water_drop/producer/dummy_client.rb +32 -0
  29. data/lib/water_drop/producer/statistics_decorator.rb +71 -0
  30. data/lib/water_drop/producer/status.rb +52 -0
  31. data/lib/water_drop/producer/sync.rb +65 -0
  32. data/lib/water_drop/version.rb +1 -1
  33. data/waterdrop.gemspec +5 -5
  34. metadata +27 -26
  35. metadata.gz.sig +0 -0
  36. data/.travis.yml +0 -35
  37. data/MIT-LICENCE +0 -18
  38. data/lib/water_drop/async_producer.rb +0 -26
  39. data/lib/water_drop/base_producer.rb +0 -57
  40. data/lib/water_drop/config_applier.rb +0 -52
  41. data/lib/water_drop/contracts/message_options.rb +0 -19
  42. data/lib/water_drop/sync_producer.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2ef3d3916d6b0e59c191c8a81ad88cc33424a4ee4ff4c7c12e65e5ad3c79ba3
4
- data.tar.gz: 1e02c7ae97e7c85e1d4aa12fe5e7c2b5611add6d41b15949fc17830382e4d99d
3
+ metadata.gz: 950a87d0cb91932f4fb6dc99dc45445948235db00d18ce03fca42f4d3262fed6
4
+ data.tar.gz: e90da26b2231c001af204d7f52de1078112b1617b38089a0e253ce8c90bb3baf
5
5
  SHA512:
6
- metadata.gz: c58aaaec32bbe3c1a930a0366447e5f69e3551619ad48ea243787b1fa487fdb3f17b5e17fd409ef956b0793dba3550a914ac15015e93cd4d81fa992f59040f7e
7
- data.tar.gz: 00f6e291c053a46c650936a7d0e03a1c20f7631d5b597df30aa1b0f2ae614873b16c8bdf58a7081f3438e894d3f20c006e736826b2adf76e12c2be49e8f42b48
6
+ metadata.gz: '0861a98c89e55cc8d0d00d15c9d251d09b4c83c27b87b0fd3b994be32eb285155fa786e8d79e61baf397e6f7eb995c05c0f6da4d4cfcf8658c56de0949d36c88'
7
+ data.tar.gz: 5527c9f42186a5764a2544252ffbf7d752842ac1c389a24d1e83a2c98744f90a3564776ff72d4ef324fa70d7c8ed6e07f05c0f1bb4e09daa8ad85859322983e8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.diffend.yml ADDED
@@ -0,0 +1,3 @@
1
+ project_id: 'ee590bc9-f375-4832-ac8e-beb174b49aa5'
2
+ shareable_id: '1325b111-b957-4fd8-bd6f-fead41e06034'
3
+ shareable_key: 'd29c6230-8bf6-479b-83ff-98f374d3466e'
@@ -0,0 +1,75 @@
1
+ name: ci
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ schedule:
7
+ - cron: '0 1 * * *'
8
+
9
+ jobs:
10
+ specs:
11
+ runs-on: ubuntu-latest
12
+ needs: diffend
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby:
17
+ - '3.0'
18
+ - '2.7'
19
+ - '2.6'
20
+ - 'jruby-head'
21
+ include:
22
+ - ruby: '3.0'
23
+ coverage: 'true'
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Install package dependencies
27
+ run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
28
+ - name: Set up Ruby
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{matrix.ruby}}
32
+ - name: Install latest bundler
33
+ run: |
34
+ gem install bundler --no-document
35
+ bundle config set without 'tools benchmarks docs'
36
+ - name: Bundle install
37
+ run: |
38
+ bundle config set without development
39
+ bundle install --jobs 4 --retry 3
40
+ - name: Run Kafka with docker-compose
41
+ run: docker-compose up -d
42
+ - name: Run all tests
43
+ env:
44
+ GITHUB_COVERAGE: ${{matrix.coverage}}
45
+ run: bundle exec rspec
46
+
47
+ diffend:
48
+ runs-on: ubuntu-latest
49
+ strategy:
50
+ fail-fast: false
51
+ steps:
52
+ - uses: actions/checkout@v2
53
+ with:
54
+ fetch-depth: 0
55
+ - name: Set up Ruby
56
+ uses: ruby/setup-ruby@v1
57
+ with:
58
+ ruby-version: 3.0
59
+ - name: Install latest bundler
60
+ run: gem install bundler --no-document
61
+ - name: Install Diffend plugin
62
+ run: bundle plugin install diffend
63
+ - name: Bundle Secure
64
+ run: bundle secure
65
+
66
+ coditsu:
67
+ runs-on: ubuntu-latest
68
+ strategy:
69
+ fail-fast: false
70
+ steps:
71
+ - uses: actions/checkout@v2
72
+ with:
73
+ fetch-depth: 0
74
+ - name: Run Coditsu
75
+ run: \curl -sSL https://api.coditsu.io/run/ci | bash
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /vendor/ruby/
5
5
  /ruby/
6
6
  app.god
7
+ example.rb
7
8
 
8
9
  # minimal Rails specific artifacts
9
10
  db/*.sqlite3
@@ -12,6 +13,7 @@ db/*.sqlite3
12
13
  *.gem
13
14
  *.~
14
15
  /.coditsu/local.yml
16
+ .byebug_history
15
17
 
16
18
  # various artifacts
17
19
  **.war
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 3.0.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # WaterDrop changelog
2
2
 
3
+ ## 2.0.1 (2021-06-05)
4
+ - Remove Ruby 2.5 support and update minimum Ruby requirement to 2.6
5
+ - Fix the `finalizer references object to be finalized` warning issued with 3.0
6
+
7
+ ## 2.0.0 (2020-12-13)
8
+ - Redesign of the whole API (see `README.md` for the use-cases and the current API)
9
+ - Replace `ruby-kafka` with `rdkafka`
10
+ - Switch license from `MIT` to `LGPL-3.0`
11
+ - #113 - Add some basic validations of the kafka scope of the config (Azdaroth)
12
+ - Global state removed
13
+ - Redesigned metrics that use `rdkafka` internal data + custom diffing
14
+ - Restore JRuby support
15
+
3
16
  ## 1.4.0 (2020-08-25)
4
17
  - Release to match Karafka 1.4 versioning.
5
18
 
data/Gemfile CHANGED
@@ -2,9 +2,18 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ plugin 'diffend'
6
+
5
7
  gemspec
6
8
 
9
+ gem 'rdkafka'
10
+
11
+ group :development do
12
+ gem 'byebug'
13
+ end
14
+
7
15
  group :test do
16
+ gem 'factory_bot'
8
17
  gem 'rspec'
9
18
  gem 'simplecov'
10
19
  end
data/Gemfile.lock CHANGED
@@ -1,102 +1,115 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- waterdrop (1.4.0)
5
- delivery_boy (>= 0.2, < 2.x)
4
+ waterdrop (2.0.1)
5
+ concurrent-ruby (>= 1.1)
6
6
  dry-configurable (~> 0.8)
7
7
  dry-monitor (~> 0.3)
8
- dry-validation (~> 1.2)
9
- ruby-kafka (>= 0.7.8)
8
+ dry-validation (~> 1.3)
9
+ rdkafka (>= 0.6.0)
10
10
  zeitwerk (~> 2.1)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- concurrent-ruby (1.1.7)
16
- delivery_boy (1.0.1)
17
- king_konf (~> 0.3)
18
- ruby-kafka (~> 1.0)
15
+ activesupport (6.1.3.2)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ byebug (11.1.3)
22
+ concurrent-ruby (1.1.9)
19
23
  diff-lcs (1.4.4)
20
- digest-crc (0.6.1)
21
- rake (~> 13.0)
22
- docile (1.3.2)
23
- dry-configurable (0.11.6)
24
+ docile (1.4.0)
25
+ dry-configurable (0.12.1)
24
26
  concurrent-ruby (~> 1.0)
25
- dry-core (~> 0.4, >= 0.4.7)
26
- dry-equalizer (~> 0.2)
27
+ dry-core (~> 0.5, >= 0.5.0)
27
28
  dry-container (0.7.2)
28
29
  concurrent-ruby (~> 1.0)
29
30
  dry-configurable (~> 0.1, >= 0.1.3)
30
- dry-core (0.4.9)
31
+ dry-core (0.6.0)
31
32
  concurrent-ruby (~> 1.0)
32
33
  dry-equalizer (0.3.0)
33
- dry-events (0.2.0)
34
+ dry-events (0.3.0)
34
35
  concurrent-ruby (~> 1.0)
35
- dry-core (~> 0.4)
36
- dry-equalizer (~> 0.2)
36
+ dry-core (~> 0.5, >= 0.5)
37
37
  dry-inflector (0.2.0)
38
- dry-initializer (3.0.3)
39
- dry-logic (1.0.7)
38
+ dry-initializer (3.0.4)
39
+ dry-logic (1.2.0)
40
40
  concurrent-ruby (~> 1.0)
41
- dry-core (~> 0.2)
42
- dry-equalizer (~> 0.2)
43
- dry-monitor (0.3.2)
41
+ dry-core (~> 0.5, >= 0.5)
42
+ dry-monitor (0.4.0)
44
43
  dry-configurable (~> 0.5)
45
- dry-core (~> 0.4)
46
- dry-equalizer (~> 0.2)
44
+ dry-core (~> 0.5, >= 0.5)
47
45
  dry-events (~> 0.2)
48
- dry-schema (1.5.3)
46
+ dry-schema (1.6.2)
49
47
  concurrent-ruby (~> 1.0)
50
48
  dry-configurable (~> 0.8, >= 0.8.3)
51
- dry-core (~> 0.4)
52
- dry-equalizer (~> 0.2)
49
+ dry-core (~> 0.5, >= 0.5)
53
50
  dry-initializer (~> 3.0)
54
51
  dry-logic (~> 1.0)
55
- dry-types (~> 1.4)
56
- dry-types (1.4.0)
52
+ dry-types (~> 1.5)
53
+ dry-types (1.5.1)
57
54
  concurrent-ruby (~> 1.0)
58
55
  dry-container (~> 0.3)
59
- dry-core (~> 0.4, >= 0.4.4)
60
- dry-equalizer (~> 0.3)
56
+ dry-core (~> 0.5, >= 0.5)
61
57
  dry-inflector (~> 0.1, >= 0.1.2)
62
58
  dry-logic (~> 1.0, >= 1.0.2)
63
- dry-validation (1.5.4)
59
+ dry-validation (1.6.0)
64
60
  concurrent-ruby (~> 1.0)
65
61
  dry-container (~> 0.7, >= 0.7.1)
66
62
  dry-core (~> 0.4)
67
63
  dry-equalizer (~> 0.2)
68
64
  dry-initializer (~> 3.0)
69
- dry-schema (~> 1.5)
70
- king_konf (0.3.7)
71
- rake (13.0.1)
72
- rspec (3.9.0)
73
- rspec-core (~> 3.9.0)
74
- rspec-expectations (~> 3.9.0)
75
- rspec-mocks (~> 3.9.0)
76
- rspec-core (3.9.2)
77
- rspec-support (~> 3.9.3)
78
- rspec-expectations (3.9.2)
65
+ dry-schema (~> 1.5, >= 1.5.2)
66
+ factory_bot (6.2.0)
67
+ activesupport (>= 5.0.0)
68
+ ffi (1.15.1)
69
+ i18n (1.8.10)
70
+ concurrent-ruby (~> 1.0)
71
+ mini_portile2 (2.6.1)
72
+ minitest (5.14.4)
73
+ rake (13.0.3)
74
+ rdkafka (0.8.1)
75
+ ffi (~> 1.9)
76
+ mini_portile2 (~> 2.1)
77
+ rake (>= 12.3)
78
+ rspec (3.10.0)
79
+ rspec-core (~> 3.10.0)
80
+ rspec-expectations (~> 3.10.0)
81
+ rspec-mocks (~> 3.10.0)
82
+ rspec-core (3.10.1)
83
+ rspec-support (~> 3.10.0)
84
+ rspec-expectations (3.10.1)
79
85
  diff-lcs (>= 1.2.0, < 2.0)
80
- rspec-support (~> 3.9.0)
81
- rspec-mocks (3.9.1)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-mocks (3.10.2)
82
88
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-support (3.9.3)
85
- ruby-kafka (1.2.0)
86
- digest-crc
87
- simplecov (0.19.0)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-support (3.10.2)
91
+ simplecov (0.21.2)
88
92
  docile (~> 1.1)
89
93
  simplecov-html (~> 0.11)
90
- simplecov-html (0.12.2)
91
- zeitwerk (2.4.0)
94
+ simplecov_json_formatter (~> 0.1)
95
+ simplecov-html (0.12.3)
96
+ simplecov_json_formatter (0.1.3)
97
+ tzinfo (2.0.4)
98
+ concurrent-ruby (~> 1.0)
99
+ zeitwerk (2.4.2)
92
100
 
93
101
  PLATFORMS
94
- ruby
102
+ x86_64-darwin
103
+ x86_64-darwin-19
104
+ x86_64-linux
95
105
 
96
106
  DEPENDENCIES
107
+ byebug
108
+ factory_bot
109
+ rdkafka
97
110
  rspec
98
111
  simplecov
99
112
  waterdrop!
100
113
 
101
114
  BUNDLED WITH
102
- 2.1.4
115
+ 2.2.19
data/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.