pgmq-ruby 0.1.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e307779e8283651d6189f25268a69628e06839845d8de6ca9b104b9bbbc0c63
4
- data.tar.gz: dae5536d6035f67546136f12ffe1fc52d602bdffc8dd5eeba120fec2313c4cd7
3
+ metadata.gz: a6b6b3dcddd3785167a0fd8482fb0900f0d51c9c5cf68ddd23b60e84eb306012
4
+ data.tar.gz: 94604bf7c55a2bd62a63486278641c247b0a9d9cf3b50379d30ee0b7c8c840f4
5
5
  SHA512:
6
- metadata.gz: ffbbc9e37967ef42d42e5357ef8de9f5e41d70897344d28f963807393f9a5035dac6721b3cbb1a754e2d5413067f1b2a10fff28dc852de5bf49ceff4e77d0e37
7
- data.tar.gz: 8cf8d948c812075b068479e25737a0d43999831f2dea87a018d6d62fe8c1049d96bb27076f88173ed91d4bd4ae1939669d768402ee9e8ce8e5c215c14014d909
6
+ metadata.gz: 3ea99c27e92f96f137c9552985830949cdff6538409646ddf6b10e587c05c2b831c8c083570996ff2c0ffbefd09ae01fa84002e2ca9093f0a27ec6f7387a2b59
7
+ data.tar.gz: 437713bad4d37ff821487493097c6229b8c2069b260b74e587b3452f74508392b1dba7cf37ee3dd91c52143a4c147db373035351a8dc0d86f1d6cd70a4370d4d
data/.coditsu/ci.yml ADDED
@@ -0,0 +1,3 @@
1
+ repository_id: '401d7537-5ac7-4691-ae02-f11fb24646d9'
2
+ api_key: <%= ENV['CODITSU_API_KEY'] %>
3
+ api_secret: <%= ENV['CODITSU_API_SECRET'] %>
@@ -0,0 +1,163 @@
1
+ name: CI
2
+
3
+ concurrency:
4
+ group: ${{ github.workflow }}-${{ github.ref }}
5
+ cancel-in-progress: true
6
+
7
+ on:
8
+ pull_request:
9
+ branches: [ master ]
10
+ schedule:
11
+ - cron: '0 1 * * *'
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ specs:
18
+ timeout-minutes: 15
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ ruby:
24
+ - '4.0.0'
25
+ - '3.4'
26
+ - '3.3'
27
+ - '3.2'
28
+ postgres:
29
+ - '14'
30
+ - '15'
31
+ - '16'
32
+ - '17'
33
+ - '18'
34
+ include:
35
+ - ruby: '3.4'
36
+ postgres: '18'
37
+ coverage: 'true'
38
+
39
+ services:
40
+ postgres:
41
+ image: ghcr.io/pgmq/pg${{ matrix.postgres }}-pgmq:latest
42
+ env:
43
+ POSTGRES_USER: postgres
44
+ POSTGRES_PASSWORD: postgres
45
+ POSTGRES_DB: pgmq_test
46
+ options: >-
47
+ --health-cmd pg_isready
48
+ --health-interval 10s
49
+ --health-timeout 5s
50
+ --health-retries 5
51
+ ports:
52
+ - 5433:5432
53
+
54
+ steps:
55
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56
+ with:
57
+ fetch-depth: 0
58
+
59
+ - name: Install package dependencies
60
+ run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends postgresql-client"
61
+
62
+ - name: Remove Gemfile.lock for Ruby previews
63
+ if: contains(matrix.ruby, '4.0')
64
+ run: rm -f Gemfile.lock
65
+
66
+ - name: Set up Ruby
67
+ uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
68
+ with:
69
+ ruby-version: ${{ matrix.ruby }}
70
+ bundler-cache: true
71
+ bundler: 'latest'
72
+ self-hosted: false
73
+
74
+ - name: Wait for PostgreSQL
75
+ run: sleep 5
76
+
77
+ - name: Install latest bundler
78
+ run: |
79
+ gem install bundler --no-document
80
+ gem update --system --no-document
81
+ bundle config set without 'tools benchmarks docs'
82
+
83
+ - name: Bundle install
84
+ run: |
85
+ bundle config set without development
86
+ bundle install --jobs 4 --retry 3
87
+
88
+ - name: Create PGMQ extension
89
+ env:
90
+ PGPASSWORD: postgres
91
+ run: |
92
+ psql -h localhost -p 5433 -U postgres -d pgmq_test -c "CREATE EXTENSION IF NOT EXISTS pgmq CASCADE;"
93
+
94
+ - name: Run all tests
95
+ env:
96
+ PG_HOST: localhost
97
+ PG_PORT: 5433
98
+ PG_DATABASE: pgmq_test
99
+ PG_USER: postgres
100
+ PG_PASSWORD: postgres
101
+ CI: true
102
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
103
+ run: bundle exec rspec
104
+
105
+ yard-lint:
106
+ timeout-minutes: 5
107
+ runs-on: ubuntu-latest
108
+ strategy:
109
+ fail-fast: false
110
+ steps:
111
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
112
+ with:
113
+ fetch-depth: 0
114
+ - name: Remove Gemfile.lock for Ruby 4.0
115
+ run: rm -f Gemfile.lock
116
+ - name: Set up Ruby
117
+ uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
118
+ with:
119
+ ruby-version: '4.0.0'
120
+ bundler-cache: true
121
+ - name: Run yard-lint
122
+ run: bundle exec yard-lint lib/
123
+
124
+ coditsu:
125
+ timeout-minutes: 5
126
+ runs-on: ubuntu-latest
127
+ strategy:
128
+ fail-fast: false
129
+ steps:
130
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
131
+ with:
132
+ fetch-depth: 0
133
+ - name: Download Coditsu script
134
+ run: |
135
+ curl -sSL https://api.coditsu.io/run/ci -o coditsu_script.sh
136
+ chmod +x coditsu_script.sh
137
+ - name: Verify Coditsu script checksum
138
+ run: |
139
+ EXPECTED_SHA256="0aecc5aa010f53fca264548a41467a2b0a1208d750ce1da3e98a217304cacbbc"
140
+ ACTUAL_SHA256=$(sha256sum coditsu_script.sh | awk '{ print $1 }')
141
+ if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then
142
+ echo "::error::Checksum verification failed. Expected $EXPECTED_SHA256 but got $ACTUAL_SHA256."
143
+ exit 1
144
+ fi
145
+ - name: Run Coditsu
146
+ run: ./coditsu_script.sh
147
+
148
+ ci-success:
149
+ name: CI Success
150
+ runs-on: ubuntu-latest
151
+ if: always()
152
+ needs:
153
+ - coditsu
154
+ - specs
155
+ - yard-lint
156
+ steps:
157
+ - name: Check all jobs passed
158
+ if: |
159
+ contains(needs.*.result, 'failure') ||
160
+ contains(needs.*.result, 'cancelled') ||
161
+ contains(needs.*.result, 'skipped')
162
+ run: exit 1
163
+ - run: echo "All CI checks passed!"
@@ -0,0 +1,35 @@
1
+ name: Push Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'mensfeld'
14
+ runs-on: ubuntu-latest
15
+ environment: deployment
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
28
+ with:
29
+ bundler-cache: false
30
+
31
+ - name: Bundle install
32
+ run: |
33
+ bundle install --jobs 4 --retry 3
34
+
35
+ - uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
data/.gitignore ADDED
@@ -0,0 +1,67 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ # Ignore Byebug command history file.
17
+ .byebug_history
18
+
19
+ ## Specific to RubyMotion:
20
+ .dat*
21
+ .repl_history
22
+ build/
23
+ *.bridgesupport
24
+ build-iPhoneOS/
25
+ build-iPhoneSimulator/
26
+
27
+ ## Specific to RubyMotion (use of CocoaPods):
28
+ #
29
+ # We recommend against adding the Pods directory to your .gitignore. However
30
+ # you should judge for yourself, the pros and cons are mentioned at:
31
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
+ #
33
+ # vendor/Pods/
34
+
35
+ ## Documentation cache and generated files:
36
+ /.yardoc/
37
+ /_yardoc/
38
+ /doc/
39
+ /rdoc/
40
+
41
+ ## RSpec test status file
42
+ .rspec_status
43
+
44
+ ## Environment normalization:
45
+ /.bundle/
46
+ /vendor/bundle
47
+ /lib/bundler/man/
48
+
49
+ # for a library or gem, you might want to ignore these files since the code is
50
+ # intended to run in multiple environments; otherwise, check them in:
51
+ # Gemfile.lock
52
+ # .ruby-version
53
+ # .ruby-gemset
54
+
55
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
56
+ .rvmrc
57
+
58
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
59
+ # .rubocop-https?--*
60
+
61
+ .DS_Store
62
+
63
+ ## Claude Code settings (user-specific)
64
+ .claude/
65
+
66
+ ## Coditsu configuration (user-specific)
67
+ .coditsu/local.yml
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 4.0.0
data/.yard-lint.yml ADDED
@@ -0,0 +1,275 @@
1
+ # YARD-Lint Configuration
2
+ # See https://github.com/mensfeld/yard-lint for documentation
3
+
4
+ # Global settings for all validators
5
+ AllValidators:
6
+ YardOptions:
7
+ - "--private"
8
+ - "--protected"
9
+ Exclude:
10
+ - "\\.git"
11
+ - vendor/**/*
12
+ - node_modules/**/*
13
+ - spec/**/*
14
+ - test/**/*
15
+ - benchmark/**/*
16
+ FailOnSeverity: convention
17
+ RequiredCoverage: 100
18
+
19
+ # Documentation validators
20
+ Documentation/UndocumentedObjects:
21
+ Description: Checks for classes, modules, and methods without documentation.
22
+ Enabled: true
23
+ Severity: error
24
+ ExcludedMethods:
25
+ - initialize/0
26
+ - "/^_/"
27
+
28
+ Documentation/UndocumentedMethodArguments:
29
+ Description: Checks for method parameters without @param tags.
30
+ Enabled: true
31
+ Severity: error
32
+
33
+ Documentation/UndocumentedBooleanMethods:
34
+ Description: Checks that question mark methods document their boolean return.
35
+ Enabled: true
36
+ Severity: error
37
+
38
+ Documentation/UndocumentedOptions:
39
+ Description: Detects methods with options hash parameters but no @option tags.
40
+ Enabled: true
41
+ Severity: error
42
+
43
+ Documentation/MarkdownSyntax:
44
+ Description: Detects common markdown syntax errors in documentation.
45
+ Enabled: true
46
+ Severity: error
47
+
48
+ Documentation/EmptyCommentLine:
49
+ Description: Detects empty comment lines at the start or end of documentation blocks.
50
+ Enabled: true
51
+ Severity: convention
52
+ EnabledPatterns:
53
+ Leading: true
54
+ Trailing: true
55
+
56
+ Documentation/BlankLineBeforeDefinition:
57
+ Description: Detects blank lines between YARD documentation and method definition.
58
+ Enabled: true
59
+ Severity: convention
60
+ OrphanedSeverity: convention
61
+ EnabledPatterns:
62
+ SingleBlankLine: true
63
+ OrphanedDocs: true
64
+
65
+ # Tags validators
66
+ Tags/Order:
67
+ Description: Enforces consistent ordering of YARD tags.
68
+ Enabled: true
69
+ Severity: error
70
+ EnforcedOrder:
71
+ - param
72
+ - option
73
+ - return
74
+ - raise
75
+ - example
76
+
77
+ Tags/InvalidTypes:
78
+ Description: Validates type definitions in @param, @return, @option tags.
79
+ Enabled: true
80
+ Severity: error
81
+ ValidatedTags:
82
+ - param
83
+ - option
84
+ - return
85
+
86
+ Tags/TypeSyntax:
87
+ Description: Validates YARD type syntax using YARD parser.
88
+ Enabled: true
89
+ Severity: error
90
+ ValidatedTags:
91
+ - param
92
+ - option
93
+ - return
94
+ - yieldreturn
95
+
96
+ Tags/MeaninglessTag:
97
+ Description: Detects @param/@option tags on classes, modules, or constants.
98
+ Enabled: true
99
+ Severity: error
100
+ CheckedTags:
101
+ - param
102
+ - option
103
+ InvalidObjectTypes:
104
+ - class
105
+ - module
106
+ - constant
107
+
108
+ Tags/CollectionType:
109
+ Description: Validates Hash collection syntax consistency.
110
+ Enabled: true
111
+ Severity: error
112
+ EnforcedStyle: long
113
+ ValidatedTags:
114
+ - param
115
+ - option
116
+ - return
117
+ - yieldreturn
118
+
119
+ Tags/TagTypePosition:
120
+ Description: Validates type annotation position in tags.
121
+ Enabled: true
122
+ Severity: error
123
+ CheckedTags:
124
+ - param
125
+ - option
126
+ EnforcedStyle: type_after_name
127
+
128
+ Tags/ApiTags:
129
+ Description: Enforces @api tags on public objects.
130
+ Enabled: false
131
+ Severity: error
132
+ AllowedApis:
133
+ - public
134
+ - private
135
+ - internal
136
+
137
+ Tags/OptionTags:
138
+ Description: Requires @option tags for methods with options parameters.
139
+ Enabled: true
140
+ Severity: error
141
+
142
+ Tags/ExampleSyntax:
143
+ Description: Validates Ruby syntax in @example tags.
144
+ Enabled: true
145
+ Severity: warning
146
+
147
+ Tags/RedundantParamDescription:
148
+ Description: Detects meaningless parameter descriptions that add no value.
149
+ Enabled: true
150
+ Severity: convention
151
+ CheckedTags:
152
+ - param
153
+ - option
154
+ Articles:
155
+ - The
156
+ - the
157
+ - A
158
+ - a
159
+ - An
160
+ - an
161
+ MaxRedundantWords: 6
162
+ GenericTerms:
163
+ - object
164
+ - instance
165
+ - value
166
+ - data
167
+ - item
168
+ - element
169
+ EnabledPatterns:
170
+ ArticleParam: true
171
+ PossessiveParam: true
172
+ TypeRestatement: true
173
+ ParamToVerb: true
174
+ IdPattern: true
175
+ DirectionalDate: true
176
+ TypeGeneric: true
177
+
178
+ Tags/InformalNotation:
179
+ Description: Detects informal tag notation patterns like "Note:" instead of @note.
180
+ Enabled: true
181
+ Severity: warning
182
+ CaseSensitive: false
183
+ RequireStartOfLine: true
184
+ Patterns:
185
+ Note: "@note"
186
+ Todo: "@todo"
187
+ TODO: "@todo"
188
+ FIXME: "@todo"
189
+ See: "@see"
190
+ See also: "@see"
191
+ Warning: "@deprecated"
192
+ Deprecated: "@deprecated"
193
+ Author: "@author"
194
+ Version: "@version"
195
+ Since: "@since"
196
+ Returns: "@return"
197
+ Raises: "@raise"
198
+ Example: "@example"
199
+
200
+ Tags/NonAsciiType:
201
+ Description: Detects non-ASCII characters in type annotations.
202
+ Enabled: true
203
+ Severity: warning
204
+ ValidatedTags:
205
+ - param
206
+ - option
207
+ - return
208
+ - yieldreturn
209
+ - yieldparam
210
+
211
+ Tags/TagGroupSeparator:
212
+ Description: Enforces blank line separators between different YARD tag groups.
213
+ Enabled: false
214
+ Severity: convention
215
+ TagGroups:
216
+ param:
217
+ - param
218
+ - option
219
+ return:
220
+ - return
221
+ error:
222
+ - raise
223
+ - throws
224
+ example:
225
+ - example
226
+ meta:
227
+ - see
228
+ - note
229
+ - todo
230
+ - deprecated
231
+ - since
232
+ - version
233
+ - api
234
+ yield:
235
+ - yield
236
+ - yieldparam
237
+ - yieldreturn
238
+ RequireAfterDescription: false
239
+
240
+ # Warnings validators - catches YARD parser errors
241
+ Warnings/UnknownTag:
242
+ Description: Detects unknown YARD tags.
243
+ Enabled: true
244
+ Severity: error
245
+
246
+ Warnings/UnknownDirective:
247
+ Description: Detects unknown YARD directives.
248
+ Enabled: true
249
+ Severity: error
250
+
251
+ Warnings/InvalidTagFormat:
252
+ Description: Detects malformed tag syntax.
253
+ Enabled: true
254
+ Severity: error
255
+
256
+ Warnings/InvalidDirectiveFormat:
257
+ Description: Detects malformed directive syntax.
258
+ Enabled: true
259
+ Severity: error
260
+
261
+ Warnings/DuplicatedParameterName:
262
+ Description: Detects duplicate @param tags.
263
+ Enabled: true
264
+ Severity: error
265
+
266
+ Warnings/UnknownParameterName:
267
+ Description: Detects @param tags for non-existent parameters.
268
+ Enabled: true
269
+ Severity: error
270
+
271
+ # Semantic validators
272
+ Semantic/AbstractMethods:
273
+ Description: Ensures @abstract methods do not have real implementations.
274
+ Enabled: true
275
+ Severity: error
data/CHANGELOG.md ADDED
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0 (2025-12-26)
4
+
5
+ ### Breaking Changes
6
+ - **[Breaking]** Rename `send` to `produce` and `send_batch` to `produce_batch`. This avoids shadowing Ruby's built-in `Object#send` method which caused confusion and required workarounds (e.g., using `__send__`). The new names also align better with the producer/consumer terminology used in message queue systems.
7
+
8
+ ### Queue Management
9
+ - [Enhancement] `create`, `create_partitioned`, and `create_unlogged` now return `true` if the queue was newly created, `false` if it already existed. This provides clearer feedback and aligns with the Rust PGMQ client behavior.
10
+
11
+ ### Message Operations
12
+ - **[Feature]** Add `headers:` parameter to `produce(queue_name, message, headers:, delay:)` for message metadata (routing, tracing, correlation IDs).
13
+ - **[Feature]** Add `headers:` parameter to `produce_batch(queue_name, messages, headers:, delay:)` for batch message metadata.
14
+ - **[Feature]** Introduce `pop_batch(queue_name, qty)` for atomic batch pop (read + delete) operations.
15
+ - **[Feature]** Introduce `set_vt_batch(queue_name, msg_ids, vt_offset:)` for batch visibility timeout updates.
16
+ - **[Feature]** Introduce `set_vt_multi(updates_hash, vt_offset:)` for updating visibility timeouts across multiple queues atomically.
17
+
18
+ ### Notifications
19
+ - **[Feature]** Introduce `enable_notify_insert(queue_name, throttle_interval_ms:)` for PostgreSQL LISTEN/NOTIFY support.
20
+ - **[Feature]** Introduce `disable_notify_insert(queue_name)` to disable notifications.
21
+
22
+ ### Compatibility
23
+ - [Enhancement] Add Ruby 4.0.0 support with full CI testing.
24
+
25
+ ## 0.3.0 (2025-11-14)
26
+
27
+ Initial release of pgmq-ruby - a low-level Ruby client for PGMQ (PostgreSQL Message Queue).
28
+
29
+ **Architecture Philosophy**: This library follows the rdkafka-ruby/Karafka pattern, providing a thin transport layer with direct 1:1 wrappers for PGMQ SQL functions. High-level features (instrumentation, job processing, Rails ActiveJob, retry strategies) belong in the planned `pgmq-framework` gem.
30
+
31
+ ### Queue Management
32
+ - **[Feature]** Introduce `create(queue_name)` for standard queue creation.
33
+ - **[Feature]** Introduce `create_partitioned(queue_name, partition_interval:, retention_interval:)` for partitioned queues.
34
+ - **[Feature]** Introduce `create_unlogged(queue_name)` for high-throughput unlogged queues.
35
+ - **[Feature]** Introduce `drop_queue(queue_name)` for queue removal.
36
+ - **[Feature]** Introduce `list_queues` to retrieve all queue metadata.
37
+ - **[Feature]** Introduce `detach_archive(queue_name)` for archive table detachment.
38
+ - [Enhancement] Add queue name validation (48-char max, PostgreSQL identifier rules).
39
+
40
+ ### Message Operations
41
+ - **[Feature]** Introduce `send(queue_name, message, delay:)` for single message publishing.
42
+ - **[Feature]** Introduce `send_batch(queue_name, messages)` for batch publishing.
43
+ - **[Feature]** Introduce `read(queue_name, vt:)` for single message consumption.
44
+ - **[Feature]** Introduce `read_batch(queue_name, vt:, qty:)` for batch consumption.
45
+ - **[Feature]** Introduce `read_with_poll(queue_name, vt:, max_poll_seconds:, poll_interval_ms:)` for long-polling.
46
+ - **[Feature]** Introduce `pop(queue_name)` for atomic read+delete operations.
47
+ - **[Feature]** Introduce `delete(queue_name, msg_id)` and `delete_batch(queue_name, msg_ids)` for message deletion.
48
+ - **[Feature]** Introduce `archive(queue_name, msg_id)` and `archive_batch(queue_name, msg_ids)` for message archival.
49
+ - **[Feature]** Introduce `purge_queue(queue_name)` for removing all messages.
50
+ - **[Feature]** Introduce `set_vt(queue_name, msg_id, vt:)` for visibility timeout updates.
51
+
52
+ ### Multi-Queue Operations
53
+ - **[Feature]** Introduce `read_multi(queue_names, vt:, qty:, limit:)` for reading from multiple queues in single SQL query.
54
+ - **[Feature]** Introduce `read_multi_with_poll(queue_names, vt:, max_poll_seconds:, poll_interval_ms:)` for long-polling multiple queues.
55
+ - **[Feature]** Introduce `pop_multi(queue_names)` for atomic read+delete from first available queue.
56
+ - **[Feature]** Introduce `delete_multi(queue_to_msg_ids_hash)` for transactional bulk delete across queues.
57
+ - **[Feature]** Introduce `archive_multi(queue_to_msg_ids_hash)` for transactional bulk archive across queues.
58
+ - [Enhancement] All multi-queue operations use single database connection for efficiency.
59
+ - [Enhancement] Support for up to 50 queues per operation with automatic validation.
60
+ - [Enhancement] Queue name returned with each message for source tracking.
61
+
62
+ ### Conditional JSONB Filtering
63
+ - **[Feature]** Introduce server-side message filtering using PostgreSQL's JSONB containment operator (`@>`).
64
+ - **[Feature]** Add `conditional:` parameter to `read()`, `read_batch()`, and `read_with_poll()` methods.
65
+ - [Enhancement] Support for filtering by single or multiple conditions with AND logic.
66
+ - [Enhancement] Support for nested JSON property filtering.
67
+ - [Enhancement] Filtering happens in PostgreSQL before returning results.
68
+
69
+ ### Transaction Support
70
+ - **[Feature]** Introduce PostgreSQL transaction support via `client.transaction do |txn|` block.
71
+ - [Enhancement] Automatic rollback on errors for queue operations.
72
+ - [Enhancement] Enable atomic multi-queue coordination and exactly-once processing patterns.
73
+
74
+ ### Monitoring & Metrics
75
+ - **[Feature]** Introduce `metrics(queue_name)` for queue statistics.
76
+ - **[Feature]** Introduce `metrics_all` for all queue statistics.
77
+ - **[Feature]** Introduce `stats()` for connection pool statistics.
78
+
79
+ ### Connection Management
80
+ - **[Feature]** Introduce thread-safe connection pooling using `connection_pool` gem.
81
+ - **[Feature]** Support multiple connection strategies (string, hash, ENV variables, callables, direct injection).
82
+ - **[Feature]** Add configurable pool size (default: 5) and timeout (default: 5 seconds).
83
+ - **[Feature]** Add `auto_reconnect` option (default: true) for automatic connection recovery.
84
+ - [Enhancement] Connection health checks before use.
85
+ - [Enhancement] Full Fiber scheduler compatibility (Ruby 3.0+).
86
+ - [Enhancement] Proper handling of stale/closed connections with automatic reset.
87
+ - [Enhancement] Clear error messages for connection pool timeout.
88
+
89
+ ### Rails Integration
90
+ - [Enhancement] Seamless ActiveRecord connection reuse via proc/lambda.
91
+ - [Enhancement] Zero additional database connections when using Rails connection pool.
92
+
93
+ ### Serialization
94
+ - **[Feature]** Introduce pluggable serializer system.
95
+ - **[Feature]** Provide JSON serializer (default).
96
+ - **[Feature]** Support custom serializers via `PGMQ::Serializers::Base`.
97
+
98
+ ### Error Handling
99
+ - **[Feature]** Introduce comprehensive error hierarchy with specific error classes for different failure modes.
100
+
101
+ ### Value Objects
102
+ - **[Feature]** Introduce `PGMQ::Message` with msg_id, read_ct, enqueued_at, vt, payload.
103
+ - **[Feature]** Introduce `PGMQ::Metrics` for queue statistics.
104
+ - **[Feature]** Introduce `PGMQ::QueueMetadata` for queue information.
105
+
106
+ ### Testing & Quality
107
+ - [Enhancement] 97.19% code coverage with 201 tests.
108
+ - [Enhancement] Comprehensive integration and unit test suites.
109
+ - [Enhancement] GitHub Actions CI/CD with matrix testing (Ruby 3.2-3.5, PostgreSQL 14-18).
110
+ - [Enhancement] Docker Compose setup for development.
111
+
112
+ ### Security
113
+ - [Enhancement] Parameterized queries for all SQL operations preventing SQL injection.
114
+
115
+ ### Documentation
116
+ - [Enhancement] Comprehensive README with quick start, API reference, and examples.
117
+ - [Enhancement] DEVELOPMENT.md for contributors.
118
+ - [Enhancement] Example scripts demonstrating all features.
119
+
120
+ ### Dependencies
121
+ - Ruby >= 3.2.0
122
+ - PostgreSQL >= 14 with PGMQ extension
123
+ - `pg` gem (~> 1.5)
124
+ - `connection_pool` gem (~> 2.4)
125
+ - `zeitwerk` gem (~> 2.6)
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem 'rake'
9
+ gem 'rspec'
10
+ gem 'yard-lint'
11
+ end
12
+
13
+ group :test do
14
+ gem 'simplecov', require: false
15
+ end