pgbus 0.18.1 → 0.19.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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +5 -0
  4. data/app/controllers/pgbus/application_controller.rb +2 -2
  5. data/app/controllers/pgbus/frontends_controller.rb +10 -8
  6. data/app/helpers/pgbus/application_helper.rb +4 -3
  7. data/app/models/pgbus/job_stat.rb +4 -0
  8. data/app/models/pgbus/processed_event.rb +3 -1
  9. data/app/models/pgbus/stream_queue.rb +34 -3
  10. data/app/models/pgbus/stream_stat.rb +3 -0
  11. data/lib/pgbus/active_job/current_attributes.rb +3 -1
  12. data/lib/pgbus/batch.rb +17 -9
  13. data/lib/pgbus/cli.rb +3 -0
  14. data/lib/pgbus/client/read_after.rb +10 -1
  15. data/lib/pgbus/client.rb +54 -9
  16. data/lib/pgbus/concurrency.rb +3 -0
  17. data/lib/pgbus/configuration.rb +84 -9
  18. data/lib/pgbus/current_attributes.rb +3 -1
  19. data/lib/pgbus/dedup_cache.rb +15 -7
  20. data/lib/pgbus/engine.rb +11 -0
  21. data/lib/pgbus/event_bus/handler.rb +16 -4
  22. data/lib/pgbus/execution_pools/async_pool.rb +23 -2
  23. data/lib/pgbus/execution_pools/thread_pool.rb +22 -0
  24. data/lib/pgbus/execution_pools.rb +26 -0
  25. data/lib/pgbus/integrations/appsignal/probe.rb +17 -9
  26. data/lib/pgbus/integrations/appsignal/subscriber.rb +30 -18
  27. data/lib/pgbus/integrations/appsignal.rb +26 -16
  28. data/lib/pgbus/mcp/rack_app.rb +1 -1
  29. data/lib/pgbus/metrics/subscriber.rb +35 -21
  30. data/lib/pgbus/process/consumer.rb +1 -1
  31. data/lib/pgbus/process/consumer_priority.rb +1 -1
  32. data/lib/pgbus/process/lifecycle.rb +5 -5
  33. data/lib/pgbus/process/notify_listener.rb +32 -18
  34. data/lib/pgbus/process/wake_pipe.rb +4 -1
  35. data/lib/pgbus/process/worker.rb +4 -2
  36. data/lib/pgbus/retry_backoff.rb +3 -0
  37. data/lib/pgbus/shareable.rb +70 -0
  38. data/lib/pgbus/streams/broadcastable_override.rb +3 -0
  39. data/lib/pgbus/streams/presence.rb +6 -7
  40. data/lib/pgbus/streams.rb +38 -27
  41. data/lib/pgbus/testing.rb +19 -3
  42. data/lib/pgbus/uniqueness.rb +3 -0
  43. data/lib/pgbus/version.rb +1 -1
  44. data/lib/pgbus/visibility_heartbeat.rb +51 -34
  45. data/lib/pgbus/web/authentication.rb +19 -2
  46. data/lib/pgbus/web/data_source/list_counts.rb +8 -6
  47. data/lib/pgbus/web/health_server.rb +4 -1
  48. data/lib/pgbus/web/process_activity.rb +1 -1
  49. data/lib/pgbus/web/streamer/heartbeat.rb +4 -1
  50. data/lib/pgbus/web/streamer/hub_client.rb +4 -1
  51. data/lib/pgbus/web/streamer/listener.rb +10 -1
  52. data/lib/pgbus/web/streamer/master_hub.rb +11 -5
  53. data/lib/pgbus/web/streamer/master_hub_boot.rb +3 -1
  54. data/lib/pgbus/web/streamer/outbound_pump.rb +4 -1
  55. data/lib/pgbus/web/streamer/peer_close_watcher.rb +4 -1
  56. data/lib/pgbus/web/streamer/stream_event_dispatcher.rb +13 -1
  57. data/lib/pgbus.rb +92 -30
  58. data/sig/pgbus/active_job/adapter.rbs +57 -0
  59. data/sig/pgbus/client.rbs +78 -0
  60. data/sig/pgbus/configuration.rbs +316 -0
  61. data/sig/pgbus/streams/stream.rbs +25 -0
  62. data/sig/pgbus/streams.rbs +22 -0
  63. data/sig/pgbus.rbs +73 -0
  64. metadata +8 -1
@@ -0,0 +1,316 @@
1
+ # The configuration (Pgbus.configure yields it). Generated from reflection:
2
+ # the setting readers carry the type of their default, the rest are untyped;
3
+ # the duration readers are Numeric? (an Integer, Float or Duration's seconds,
4
+ # or nil where the setting is off).
5
+ # spec/pgbus/rbs_spec.rb fails when a public method is missing here.
6
+ module Pgbus
7
+ class Configuration
8
+ def allowed_global_id_models: () -> untyped
9
+ def allowed_global_id_models=: (untyped) -> untyped
10
+ def apply_log_format!: () -> void
11
+ def appsignal_enabled: () -> bool
12
+ def appsignal_enabled=: (untyped) -> untyped
13
+ def appsignal_probe_enabled: () -> bool
14
+ def appsignal_probe_enabled=: (untyped) -> untyped
15
+ def archive_retention: () -> Numeric?
16
+ def archive_retention=: (untyped value) -> untyped
17
+ def base_controller_class: () -> String
18
+ def base_controller_class=: (untyped) -> untyped
19
+ def batch_retention: () -> Numeric?
20
+ def batch_retention=: (untyped value) -> untyped
21
+ def batch_stall_threshold: () -> Numeric?
22
+ def batch_stall_threshold=: (untyped value) -> untyped
23
+ def batch_sweep_interval: () -> Numeric?
24
+ def batch_sweep_interval=: (untyped value) -> untyped
25
+ def capsule: (untyped name, queues: untyped, threads: untyped, **untyped options) -> untyped
26
+ def capsule_named: (untyped name) -> untyped
27
+ def circuit_breaker_enabled: () -> bool
28
+ def circuit_breaker_enabled=: (untyped) -> untyped
29
+ def connection_guc_mode: () -> Symbol
30
+ def connection_guc_mode=: (untyped mode) -> untyped
31
+ def connection_options: () -> untyped
32
+ def connection_params: () -> untyped
33
+ def connection_params=: (untyped) -> untyped
34
+ def connects_to: () -> untyped
35
+ def connects_to=: (untyped) -> untyped
36
+ def current_attributes: () -> untyped
37
+ def current_attributes=: (untyped value) -> untyped
38
+ def dashboard_filter_parameters: () -> untyped
39
+ def dashboard_filter_parameters=: (untyped value) -> untyped
40
+ def dashboard_filter_sensitive: () -> untyped
41
+ def dashboard_filter_sensitive=: (untyped value) -> untyped
42
+ def database_url: () -> untyped
43
+ def database_url=: (untyped) -> untyped
44
+ def dead_letter_queue_name: (untyped name) -> untyped
45
+ def default_priority: () -> Integer
46
+ def default_priority=: (untyped) -> untyped
47
+ def default_queue: () -> String
48
+ def default_queue=: (untyped) -> untyped
49
+ def dispatch_interval: () -> Float
50
+ def dispatch_interval=: (untyped) -> untyped
51
+ def doctor_on_boot: () -> untyped
52
+ def doctor_on_boot=: (untyped mode) -> untyped
53
+ def drain_timeout: () -> Integer
54
+ def drain_timeout=: (untyped) -> untyped
55
+ def eager_validation: () -> bool
56
+ def eager_validation=: (untyped) -> untyped
57
+ def effective_visibility_heartbeat_interval: () -> untyped
58
+ def error_reporters: () -> Array[untyped]
59
+ def error_reporters=: (untyped) -> untyped
60
+ def event_consumers: () -> untyped
61
+ def event_consumers=: (untyped value) -> untyped
62
+ def event_fair_share: () -> untyped
63
+ def event_fair_share=: (untyped callable) -> untyped
64
+ def execution_mode: () -> Symbol
65
+ def execution_mode=: (untyped) -> untyped
66
+ def execution_mode_for: (untyped worker_config) -> untyped
67
+ def fair_share: () -> untyped
68
+ def fair_share=: (untyped callable) -> untyped
69
+ def finalize!: () -> untyped
70
+ def finalized?: () -> bool
71
+ def group_mode: () -> untyped
72
+ def group_mode=: (untyped mode) -> untyped
73
+ def health_bind: () -> String
74
+ def health_bind=: (untyped) -> untyped
75
+ def health_port: () -> untyped
76
+ def health_port=: (untyped) -> untyped
77
+ def idempotency_ttl: () -> Numeric?
78
+ def idempotency_ttl=: (untyped value) -> untyped
79
+ def immediate_shutdown_grace: () -> Integer
80
+ def immediate_shutdown_grace=: (untyped) -> untyped
81
+ def insights_default_minutes: () -> Integer
82
+ def insights_default_minutes=: (untyped) -> untyped
83
+ def listen_notify: () -> bool
84
+ def listen_notify=: (untyped) -> untyped
85
+ def log_format: () -> Symbol
86
+ def log_format=: (untyped format) -> untyped
87
+ def logger: () -> untyped
88
+ def logger=: (untyped) -> untyped
89
+ def max_jobs_per_worker: () -> untyped
90
+ def max_jobs_per_worker=: (untyped) -> untyped
91
+ def max_memory_mb: () -> untyped
92
+ def max_memory_mb=: (untyped) -> untyped
93
+ def max_retries: () -> Integer
94
+ def max_retries=: (untyped) -> untyped
95
+ def max_worker_lifetime: () -> untyped
96
+ def max_worker_lifetime=: (untyped) -> untyped
97
+ def metrics_backend: () -> untyped
98
+ def metrics_backend=: (untyped) -> untyped
99
+ def metrics_enabled: () -> bool
100
+ def metrics_enabled=: (untyped) -> untyped
101
+ def notify_presence_change: (untyped stream_name, untyped change) -> untyped
102
+ def outbox_batch_size: () -> Integer
103
+ def outbox_batch_size=: (untyped) -> untyped
104
+ def outbox_enabled: () -> bool
105
+ def outbox_enabled=: (untyped) -> untyped
106
+ def outbox_poll_interval: () -> Float
107
+ def outbox_poll_interval=: (untyped) -> untyped
108
+ def outbox_retention: () -> Numeric?
109
+ def outbox_retention=: (untyped value) -> untyped
110
+ def pgmq_schema_mode: () -> Symbol
111
+ def pgmq_schema_mode=: (untyped mode) -> untyped
112
+ def polling_interval: () -> Float
113
+ def polling_interval=: (untyped) -> untyped
114
+ def pool_size: () -> untyped
115
+ def pool_size=: (untyped) -> untyped
116
+ def pool_timeout: () -> Integer
117
+ def pool_timeout=: (untyped) -> untyped
118
+ def prefetch_limit: () -> untyped
119
+ def prefetch_limit=: (untyped) -> untyped
120
+ def presence_member_for: (untyped context) -> untyped
121
+ def presence_min_ttl: () -> untyped
122
+ def presence_ttl_for: (untyped stream_name) -> untyped
123
+ def priority_levels: () -> untyped
124
+ def priority_levels=: (untyped) -> untyped
125
+ def priority_queue_name: (untyped name, untyped priority) -> untyped
126
+ def priority_queue_names: (untyped name) -> untyped
127
+ def processes_for: (untyped entry) -> untyped
128
+ def queue_name: (untyped name) -> untyped
129
+ def queue_prefix: () -> String
130
+ def queue_prefix=: (untyped) -> untyped
131
+ def read_ahead: () -> Integer
132
+ def read_ahead=: (untyped value) -> untyped
133
+ def read_ahead_for: (untyped entry) -> untyped
134
+ def read_timeout: () -> Integer
135
+ def read_timeout=: (untyped) -> untyped
136
+ def recurring_enabled: () -> bool
137
+ def recurring_enabled=: (untyped) -> untyped
138
+ def recurring_execution_retention: () -> Numeric?
139
+ def recurring_execution_retention=: (untyped value) -> untyped
140
+ def recurring_schedule_interval: () -> Float
141
+ def recurring_schedule_interval=: (untyped) -> untyped
142
+ def recurring_tasks: () -> untyped
143
+ def recurring_tasks=: (untyped) -> untyped
144
+ def recurring_tasks_file: () -> untyped
145
+ def recurring_tasks_file=: (untyped) -> untyped
146
+ def recurring_tasks_files: () -> untyped
147
+ def recurring_tasks_files=: (untyped) -> untyped
148
+ def recycle_limit_for: (untyped entry, untyped key) -> untyped
149
+ def require_primary: () -> bool
150
+ def require_primary=: (untyped) -> untyped
151
+ def resolved_pool_size: () -> untyped
152
+ def retry_backoff: () -> Integer
153
+ def retry_backoff=: (untyped) -> untyped
154
+ def retry_backoff_jitter: () -> Float
155
+ def retry_backoff_jitter=: (untyped) -> untyped
156
+ def retry_backoff_max: () -> Integer
157
+ def retry_backoff_max=: (untyped) -> untyped
158
+ def return_to_app_url: () -> untyped
159
+ def return_to_app_url=: (untyped) -> untyped
160
+ def role_enabled?: (untyped role) -> bool
161
+ def roles: () -> untyped
162
+ def roles=: (untyped value) -> untyped
163
+ def shutdown_timeout: () -> Integer
164
+ def shutdown_timeout=: (untyped) -> untyped
165
+ def skip_recurring: () -> untyped
166
+ def skip_recurring=: (untyped value) -> untyped
167
+ def stall_threshold: () -> Integer
168
+ def stall_threshold=: (untyped) -> untyped
169
+ def stats_enabled: () -> bool
170
+ def stats_enabled=: (untyped) -> untyped
171
+ def stats_flush_interval: () -> Integer
172
+ def stats_flush_interval=: (untyped) -> untyped
173
+ def stats_flush_size: () -> Integer
174
+ def stats_flush_size=: (untyped) -> untyped
175
+ def stats_retention: () -> Numeric?
176
+ def stats_retention=: (untyped value) -> untyped
177
+ def statsd_host: () -> String
178
+ def statsd_host=: (untyped) -> untyped
179
+ def statsd_port: () -> Integer
180
+ def statsd_port=: (untyped) -> untyped
181
+ def stream_durable?: (untyped name) -> bool
182
+ def stream_presence?: (untyped name) -> bool
183
+ def streams_application_name: () -> String
184
+ def streams_application_name=: (untyped) -> untyped
185
+ def streams_authorize: () -> untyped
186
+ def streams_authorize=: (untyped) -> untyped
187
+ def streams_broadcast_queue: () -> untyped
188
+ def streams_broadcast_queue=: (untyped) -> untyped
189
+ def streams_connection_options: () -> untyped
190
+ def streams_database_url: () -> untyped
191
+ def streams_database_url=: (untyped) -> untyped
192
+ def streams_default_broadcast_mode: () -> Symbol
193
+ def streams_default_broadcast_mode=: (untyped mode) -> untyped
194
+ def streams_default_retention: () -> Integer
195
+ def streams_default_retention=: (untyped) -> untyped
196
+ def streams_dispatch_queue_limit: () -> Integer
197
+ def streams_dispatch_queue_limit=: (untyped) -> untyped
198
+ def streams_durable_patterns: () -> Array[untyped]
199
+ def streams_durable_patterns=: (untyped) -> untyped
200
+ def streams_enabled: () -> bool
201
+ def streams_enabled=: (untyped) -> untyped
202
+ def streams_falcon_streaming_body: () -> bool
203
+ def streams_falcon_streaming_body=: (untyped) -> untyped
204
+ def streams_fanout_write_deadline_ms: () -> Integer
205
+ def streams_fanout_write_deadline_ms=: (untyped) -> untyped
206
+ def streams_heartbeat_interval: () -> Integer
207
+ def streams_heartbeat_interval=: (untyped) -> untyped
208
+ def streams_host: () -> untyped
209
+ def streams_host=: (untyped) -> untyped
210
+ def streams_idle_timeout: () -> Integer
211
+ def streams_idle_timeout=: (untyped) -> untyped
212
+ def streams_listen_health_check_ms: () -> Integer
213
+ def streams_listen_health_check_ms=: (untyped) -> untyped
214
+ def streams_listen_scope: () -> Symbol
215
+ def streams_listen_scope=: (untyped scope) -> untyped
216
+ def streams_max_connections: () -> Integer
217
+ def streams_max_connections=: (untyped) -> untyped
218
+ def streams_orphan_sweep_interval: () -> Integer
219
+ def streams_orphan_sweep_interval=: (untyped) -> untyped
220
+ def streams_orphan_threshold: () -> Integer
221
+ def streams_orphan_threshold=: (untyped) -> untyped
222
+ def streams_path: () -> untyped
223
+ def streams_path=: (untyped) -> untyped
224
+ def streams_peer_close_interval: () -> Float
225
+ def streams_peer_close_interval=: (untyped) -> untyped
226
+ def streams_pool_autoscale: () -> bool
227
+ def streams_pool_autoscale=: (untyped) -> untyped
228
+ def streams_pool_autoscale_interval: () -> Float
229
+ def streams_pool_autoscale_interval=: (untyped) -> untyped
230
+ def streams_pool_connection_options: () -> untyped
231
+ def streams_pool_database_url: () -> untyped
232
+ def streams_pool_database_url=: (untyped) -> untyped
233
+ def streams_pool_host: () -> untyped
234
+ def streams_pool_host=: (untyped) -> untyped
235
+ def streams_pool_max: () -> untyped
236
+ def streams_pool_max=: (untyped) -> untyped
237
+ def streams_pool_port: () -> untyped
238
+ def streams_pool_port=: (untyped) -> untyped
239
+ def streams_pool_size: () -> Integer
240
+ def streams_pool_size=: (untyped) -> untyped
241
+ def streams_pool_timeout: () -> Integer
242
+ def streams_pool_timeout=: (untyped) -> untyped
243
+ def streams_port: () -> untyped
244
+ def streams_port=: (untyped) -> untyped
245
+ def streams_presence_member: () -> untyped
246
+ def streams_presence_member=: (untyped) -> untyped
247
+ def streams_presence_on_change: () -> untyped
248
+ def streams_presence_on_change=: (untyped) -> untyped
249
+ def streams_presence_patterns: () -> Array[untyped]
250
+ def streams_presence_patterns=: (untyped) -> untyped
251
+ def streams_presence_ttl: () -> untyped
252
+ def streams_presence_ttl=: (untyped) -> untyped
253
+ def streams_retention: () -> Hash[untyped, untyped]
254
+ def streams_retention=: (untyped) -> untyped
255
+ def streams_signed_name_secret: () -> untyped
256
+ def streams_signed_name_secret=: (untyped) -> untyped
257
+ def streams_stats_enabled: () -> bool
258
+ def streams_stats_enabled=: (untyped) -> untyped
259
+ def streams_test_mode: () -> bool
260
+ def streams_test_mode=: (untyped) -> untyped
261
+ def streams_write_deadline_ms: () -> Integer
262
+ def streams_write_deadline_ms=: (untyped) -> untyped
263
+ def streams_writer_buffer_limit: () -> Integer
264
+ def streams_writer_buffer_limit=: (untyped) -> untyped
265
+ def streams_writer_threads: () -> Integer
266
+ def streams_writer_threads=: (untyped) -> untyped
267
+ def validate!: () -> untyped
268
+ def validate_capsule_processes!: () -> untyped
269
+ def validate_fair_share!: () -> untyped
270
+ def validate_job_path_gaps!: () -> untyped
271
+ def validate_metrics_backend!: () -> untyped
272
+ def validate_processes!: (untyped value) -> untyped
273
+ def validate_read_ahead!: () -> untyped
274
+ def validate_shutdown_timeout!: () -> untyped
275
+ def validate_streams!: () -> untyped
276
+ def validate_streams_autoscale!: () -> untyped
277
+ def validate_visibility_heartbeat!: () -> untyped
278
+ def visibility_heartbeat: () -> bool
279
+ def visibility_heartbeat=: (untyped) -> untyped
280
+ def visibility_heartbeat_interval: () -> Numeric?
281
+ def visibility_heartbeat_interval=: (untyped value) -> untyped
282
+ def visibility_timeout: () -> Numeric?
283
+ def visibility_timeout=: (untyped value) -> untyped
284
+ def warn_read_ahead_without_heartbeat: (untyped settings) -> untyped
285
+ def web_auth: () -> untyped
286
+ def web_auth=: (untyped) -> untyped
287
+ def web_data_source: () -> untyped
288
+ def web_data_source=: (untyped) -> untyped
289
+ def web_filter_parameters: () -> untyped
290
+ def web_filter_parameters=: (untyped) -> untyped
291
+ def web_filter_sensitive: () -> bool
292
+ def web_filter_sensitive=: (untyped) -> untyped
293
+ def web_live_updates: () -> bool
294
+ def web_live_updates=: (untyped) -> untyped
295
+ def web_per_page: () -> Integer
296
+ def web_per_page=: (untyped) -> untyped
297
+ def web_refresh_interval: () -> Integer
298
+ def web_refresh_interval=: (untyped) -> untyped
299
+ def worker_notify_connection_options: () -> untyped
300
+ def worker_notify_database_url: () -> untyped
301
+ def worker_notify_database_url=: (untyped) -> untyped
302
+ def worker_notify_host: () -> untyped
303
+ def worker_notify_host=: (untyped) -> untyped
304
+ def worker_notify_port: () -> untyped
305
+ def worker_notify_port=: (untyped) -> untyped
306
+ def worker_notify_scope: () -> Symbol
307
+ def worker_notify_scope=: (untyped scope) -> untyped
308
+ def worker_notify_wakeup: () -> untyped
309
+ def worker_notify_wakeup=: (untyped) -> untyped
310
+ def worker_notify_wakeup?: () -> bool
311
+ def workers: () -> Array[untyped]
312
+ def workers=: (untyped value) -> untyped
313
+ def zombie_detection: () -> bool
314
+ def zombie_detection=: (untyped) -> untyped
315
+ end
316
+ end
@@ -0,0 +1,25 @@
1
+ module Pgbus
2
+ module Streams
3
+ # A handle on one logical stream: Pgbus.stream(name).broadcast(html).
4
+ class Stream
5
+ # nil when a streamable's to_param returns nil (an unsaved record).
6
+ def self.name_from: (untyped streamables) -> String?
7
+ def self.validate_name_length!: (String name, untyped streamables) -> void
8
+
9
+ def initialize: (untyped streamables, ?client: Pgbus::Client, ?durable: bool) -> void
10
+ def name: () -> String
11
+ def durable?: () -> bool
12
+
13
+ # The msg_id when sent at once; nil when deferred to after_commit, or
14
+ # when coalesced.
15
+ def broadcast: (String payload, ?visible_to: Symbol?, ?durable: bool?, ?exclude: String?, ?event: String?,
16
+ ?coalesce: (bool | Numeric)?, ?target: String?) -> Integer?
17
+ def broadcast_render: (target: String, ?action: Symbol, ?renderable: untyped, ?visible_to: Symbol?, ?durable: bool?,
18
+ ?exclude: String?, ?event: String?, ?coalesce: (bool | Numeric)?) -> Integer?
19
+ def current_msg_id: () -> Integer
20
+ def read_after: (after_id: Integer, ?limit: Integer) -> Array[untyped]
21
+ def ensure!: () -> self
22
+ def presence: () -> untyped
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ module Pgbus
2
+ # Streams: broadcasting rendered updates over PGMQ (Pgbus.stream).
3
+ module Streams
4
+ DEFAULT_SSE_EVENT: String
5
+
6
+ class StreamNameTooLong < ArgumentError
7
+ end
8
+
9
+ class PayloadTooLarge < Pgbus::Error
10
+ end
11
+
12
+ def self.filters: () -> untyped
13
+ def self.coalescer: () -> untyped
14
+ def self.reset_filters!: () -> untyped
15
+ def self.reset_coalescer!: () -> untyped
16
+
17
+ # The Turbo patches, installed by the engine when turbo-rails is loaded.
18
+ def self.install_turbo_broadcastable_patch!: () -> void
19
+ def self.install_turbo_stream_override!: () -> void
20
+ def self.install_broadcast_queue!: (String? queue_name) -> void
21
+ end
22
+ end
data/sig/pgbus.rbs ADDED
@@ -0,0 +1,73 @@
1
+ # The public surface of pgbus (issue #527). `bundle exec rbs validate` checks
2
+ # these files; spec/pgbus/rbs_spec.rb checks they cover the public methods.
3
+ module Pgbus
4
+ VERSION: String
5
+ DEAD_LETTER_SUFFIX: String
6
+ DATABASE_TASK_PREFIXES: Array[String]
7
+
8
+ class Error < StandardError
9
+ end
10
+
11
+ class ConfigurationError < Error
12
+ end
13
+
14
+ class SerializationError < Error
15
+ end
16
+
17
+ class QueueNotFoundError < Error
18
+ end
19
+
20
+ class DeadLetterError < Error
21
+ end
22
+
23
+ class ConcurrencyLimitExceeded < Error
24
+ end
25
+
26
+ class JobNotUnique < Error
27
+ end
28
+
29
+ class SchemaNotReady < Error
30
+ end
31
+
32
+ class ReadTimeoutError < Error
33
+ end
34
+
35
+ class EnqueueError < Error
36
+ end
37
+
38
+ class CurrentAttributesError < Error
39
+ end
40
+
41
+ class ExecutionPoolError < Error
42
+ end
43
+
44
+ class ConnectionCircuitOpenError < Error
45
+ end
46
+
47
+ module Process
48
+ class ReplicaConnectionError < Error
49
+ end
50
+ end
51
+
52
+ def self.configuration: () -> Configuration
53
+ def self.configure: () { (Configuration) -> void } -> Configuration
54
+ def self.finalize!: () -> Configuration
55
+ def self.client: () -> Client
56
+ def self.stream: (untyped streamables, ?durable: bool?) -> Streams::Stream
57
+ def self.stream_key: (*untyped parts, ?digest_bits: Integer) -> String
58
+ def self.stream_key!: (String key) -> String
59
+ def self.stream_name_budget: () -> Integer
60
+ # delay: seconds, as a Numeric or an ActiveSupport::Duration (1.hour).
61
+ def self.publish: (String routing_key, untyped payload, ?headers: Hash[String, untyped]?, ?delay: Numeric | _ToI) -> untyped
62
+ def self.publish_later: (String routing_key, untyped payload, delay: Numeric | _ToI, ?headers: Hash[String, untyped]?) -> untyped
63
+ def self.reset!: () -> void
64
+ def self.reset_client!: () -> void
65
+ def self.stopping: () -> bool
66
+ def self.stopping=: (boolish value) -> bool
67
+ def self.logger: () -> untyped
68
+ def self.logger=: (untyped value) -> untyped
69
+ def self.database_task?: () -> bool
70
+ def self.loader: () -> untyped
71
+ def self.models_loader: () -> untyped
72
+ def self.teardown_models_loader!: () -> void
73
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -414,6 +414,7 @@ files:
414
414
  - lib/pgbus/retry_backoff.rb
415
415
  - lib/pgbus/ruby_jit.rb
416
416
  - lib/pgbus/serializer.rb
417
+ - lib/pgbus/shareable.rb
417
418
  - lib/pgbus/stat_buffer.rb
418
419
  - lib/pgbus/streams.rb
419
420
  - lib/pgbus/streams/broadcast_opts.rb
@@ -490,6 +491,12 @@ files:
490
491
  - lib/tasks/pgbus_pgmq.rake
491
492
  - lib/tasks/pgbus_queues.rake
492
493
  - lib/tasks/pgbus_streams.rake
494
+ - sig/pgbus.rbs
495
+ - sig/pgbus/active_job/adapter.rbs
496
+ - sig/pgbus/client.rbs
497
+ - sig/pgbus/configuration.rbs
498
+ - sig/pgbus/streams.rbs
499
+ - sig/pgbus/streams/stream.rbs
493
500
  homepage: https://github.com/zoolutions/pgbus
494
501
  licenses:
495
502
  - MIT