riverqueue 0.12.0 → 0.14.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 +4 -4
- data/CHANGELOG.md +80 -4
- data/README.md +91 -0
- data/docs/README.md +213 -36
- data/docs/conformance.md +72 -0
- data/docs/migrations.md +20 -23
- data/docs/testing.md +1 -1
- data/lib/client.rb +103 -15
- data/lib/client_runtime.rb +434 -87
- data/lib/config.rb +61 -9
- data/lib/driver/job_row_decoder.rb +2 -2
- data/lib/driver/notification_listener.rb +61 -0
- data/lib/driver/postgres_capabilities.rb +1 -1
- data/lib/driver/runtime.rb +419 -146
- data/lib/driver.rb +1 -0
- data/lib/event.rb +8 -1
- data/lib/insert_opts.rb +8 -3
- data/lib/job.rb +5 -5
- data/lib/job_persisted_logging/plugin.rb +3 -2
- data/lib/migrator.rb +1 -1
- data/lib/periodic_cron.rb +42 -6
- data/lib/periodic_job.rb +23 -4
- data/lib/resumable.rb +24 -1
- data/lib/worker.rb +32 -2
- data/migration/README.md +4 -2
- data/migration/manifest.json +6 -7
- data/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.down.sql +1 -1
- data/migration/postgresql/main/007_notification_outbox_sqlite_jsonb_and_sql_cleanup.up.sql +1 -1
- data/migration/postgresql/main/008_job_id_autoincrement.down.sql +1 -1
- data/migration/postgresql/main/008_job_id_autoincrement.up.sql +1 -1
- data/migration/sqlite/main/008_job_id_autoincrement.up.sql +1 -1
- data/sig/client.rbs +9 -3
- data/sig/driver.rbs +46 -9
- data/sig/insert_opts.rbs +2 -2
- data/sig/job.rbs +2 -0
- data/sig/runtime.rbs +76 -8
- metadata +9 -6
data/sig/driver.rbs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module River
|
|
2
2
|
interface _Driver
|
|
3
|
+
def after_commit: () { () -> void } -> void
|
|
3
4
|
def respond_to?: (Symbol, ?bool) -> bool
|
|
5
|
+
def in_transaction?: () -> bool
|
|
4
6
|
def init_driver: () -> void
|
|
5
7
|
def migration_backend: () -> Symbol
|
|
6
8
|
def migration_connection: [A] () { (untyped) -> A } -> A
|
|
@@ -8,16 +10,16 @@ module River
|
|
|
8
10
|
def job_cancel: (Integer, ?now: Time) -> JobRow?
|
|
9
11
|
def job_delete: (Integer) -> JobRow?
|
|
10
12
|
def job_delete_finalized: (**untyped) -> Integer
|
|
11
|
-
def job_delete_if_running: (Integer) -> bool
|
|
13
|
+
def job_delete_if_running: (Integer) -> (bool | :cancelled)
|
|
12
14
|
def job_delete_many: (JobListParams) -> Array[JobRow]
|
|
13
15
|
def job_get_available: (queue: String, max: Integer, attempted_by: String, ?kinds: Array[String]?, ?now: Time) -> Array[JobRow]
|
|
14
16
|
def job_claim: (id: Integer, attempted_by: String, ?allow_scheduled: bool, ?now: Time) -> JobRow?
|
|
15
17
|
def job_get_cancelled_ids: (Array[Integer]) -> Array[Integer]
|
|
16
|
-
def job_complete: (id: Integer, finalized_at: Time, ?metadata: Hash[untyped, untyped]?, ?now: Time) -> (JobRow | :cancelled)?
|
|
18
|
+
def job_complete: (id: Integer, finalized_at: Time, ?expected_job: JobRow?, ?metadata: Hash[untyped, untyped]?, ?now: Time) -> (JobRow | :cancelled)?
|
|
17
19
|
def job_get_by_kind_and_unique_properties: (Driver::JobGetByKindAndUniquePropertiesParam) -> JobRow?
|
|
18
20
|
def job_insert: (Driver::JobInsertParams) -> [JobRow, bool]
|
|
19
21
|
def job_insert_many: (Array[Driver::JobInsertParams]) -> Array[[JobRow, bool]]
|
|
20
|
-
def job_metadata_merge: (Integer, Hash[untyped, untyped]) -> JobRow?
|
|
22
|
+
def job_metadata_merge: (Integer, Hash[untyped, untyped], ?JobRow?) -> JobRow?
|
|
21
23
|
def job_rescue_stuck: (**untyped) -> Integer
|
|
22
24
|
def job_retry: (Integer, ?now: Time) -> JobRow?
|
|
23
25
|
def job_schedule: (?now: Time, ?max: Integer) -> Integer
|
|
@@ -26,13 +28,17 @@ module River
|
|
|
26
28
|
def leader_acquire: (String, ?ttl: Integer, ?now: Time) -> bool
|
|
27
29
|
def leader_release: (String) -> untyped
|
|
28
30
|
def leader_renew: (String, ?ttl: Integer, ?now: Time) -> bool
|
|
31
|
+
def normalize_time: (Time) -> Time
|
|
29
32
|
def notification_delete_before: (horizon: Time, ?max: Integer) -> Integer
|
|
33
|
+
def notification_listener: () -> untyped
|
|
34
|
+
def request_resign: () -> nil
|
|
30
35
|
def queue_get: (String) -> Queue?
|
|
31
36
|
def queue_list: (?max: Integer) -> Array[Queue]
|
|
32
|
-
def queue_pause: (String, ?now: Time) ->
|
|
33
|
-
def queue_resume: (String, ?now: Time) ->
|
|
37
|
+
def queue_pause: (String, ?now: Time) -> Array[Queue]
|
|
38
|
+
def queue_resume: (String, ?now: Time) -> Array[Queue]
|
|
34
39
|
def queue_update: (String, metadata: Hash[untyped, untyped], ?now: Time) -> Queue?
|
|
35
40
|
def queue_upsert: (String, ?metadata: Hash[untyped, untyped], ?now: Time) -> Queue?
|
|
41
|
+
def time_precision: () -> Rational
|
|
36
42
|
def transaction: [T] () { () -> T } -> T
|
|
37
43
|
|
|
38
44
|
# this set of methods is used only in tests
|
|
@@ -56,6 +62,25 @@ module River
|
|
|
56
62
|
def finish: (JobRow) -> JobRow
|
|
57
63
|
end
|
|
58
64
|
|
|
65
|
+
module NotificationListener
|
|
66
|
+
TOPICS: Array[String]
|
|
67
|
+
class Postgres
|
|
68
|
+
@connection: untyped
|
|
69
|
+
@channels: Hash[String, String]
|
|
70
|
+
def initialize: (untyped, String) -> void
|
|
71
|
+
def close: () -> untyped
|
|
72
|
+
def poll: (Float | Integer) -> Array[untyped]
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class SQLite
|
|
76
|
+
@query: untyped
|
|
77
|
+
@last_id: Integer
|
|
78
|
+
def initialize: (untyped) -> void
|
|
79
|
+
def close: () -> nil
|
|
80
|
+
def poll: (Float | Integer) -> Array[untyped]
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
59
84
|
class PostgresCapabilities
|
|
60
85
|
attr_reader supports_listen_notify: bool
|
|
61
86
|
attr_reader unique_insert_mode: :metadata_nonce | :returning_old | :xmax
|
|
@@ -103,10 +128,11 @@ module River
|
|
|
103
128
|
def runtime_decode_postgres_job: (untyped) -> JobRow
|
|
104
129
|
@postgres_capabilities_cache: PostgresCapabilities::Cache
|
|
105
130
|
def init_driver: () -> void
|
|
131
|
+
def normalize_time: (Time) -> Time
|
|
106
132
|
def postgres_capabilities: () -> PostgresCapabilities
|
|
107
133
|
def postgres_notify_insert: (Array[JobInsertParams]) -> void
|
|
108
134
|
def job_get_cancelled_ids: (Array[Integer]) -> Array[Integer]
|
|
109
|
-
def job_complete: (id: untyped, finalized_at: untyped, ?metadata: untyped, ?now: untyped) -> untyped
|
|
135
|
+
def job_complete: (id: untyped, finalized_at: untyped, ?expected_job: untyped, ?metadata: untyped, ?now: untyped) -> untyped
|
|
110
136
|
def job_cancel: (untyped, ?now: untyped) -> untyped
|
|
111
137
|
def job_delete: (untyped) -> untyped
|
|
112
138
|
def job_delete_finalized: (retention: untyped, ?now: untyped, ?max: untyped) -> untyped
|
|
@@ -116,8 +142,8 @@ module River
|
|
|
116
142
|
def job_claim: (id: untyped, attempted_by: untyped, ?allow_scheduled: untyped, ?now: untyped) -> untyped
|
|
117
143
|
private def runtime_claim_jobs: (untyped, untyped, untyped, untyped) -> untyped
|
|
118
144
|
def job_list: (?untyped) -> untyped
|
|
119
|
-
def job_metadata_merge: (untyped, untyped) -> untyped
|
|
120
|
-
def job_rescue_stuck: (horizon: untyped, retry_policy: untyped, ?now: untyped, ?max: untyped) -> untyped
|
|
145
|
+
def job_metadata_merge: (untyped, untyped, ?untyped) -> untyped
|
|
146
|
+
def job_rescue_stuck: (horizon: untyped, retry_policy: untyped, ?now: untyped, ?max: untyped, ?logger: untyped, ?rescue_if: untyped) -> untyped
|
|
121
147
|
def job_retry: (untyped, ?now: untyped) -> untyped
|
|
122
148
|
def job_schedule: (?now: untyped, ?max: untyped) -> untyped
|
|
123
149
|
def job_set_state_if_running: (id: untyped, state: untyped, ?now: untyped, ?attempt: untyped, ?error: untyped, ?finalized_at: untyped, ?metadata: untyped, ?scheduled_at: untyped) -> untyped
|
|
@@ -126,6 +152,8 @@ module River
|
|
|
126
152
|
def leader_release: (untyped) -> untyped
|
|
127
153
|
def leader_renew: (untyped, ?ttl: untyped, ?now: untyped) -> untyped
|
|
128
154
|
def notification_delete_before: (horizon: untyped, ?max: untyped) -> untyped
|
|
155
|
+
def notification_listener: () -> untyped
|
|
156
|
+
def request_resign: () -> nil
|
|
129
157
|
def queue_get: (untyped) -> untyped
|
|
130
158
|
def queue_list: (?max: untyped) -> untyped
|
|
131
159
|
def queue_pause: (untyped, ?now: untyped) -> untyped
|
|
@@ -133,6 +161,8 @@ module River
|
|
|
133
161
|
def queue_update: (untyped, metadata: untyped, ?now: untyped) -> untyped
|
|
134
162
|
def queue_upsert: (untyped, ?metadata: untyped, ?now: untyped) -> untyped
|
|
135
163
|
|
|
164
|
+
def time_precision: () -> Rational
|
|
165
|
+
|
|
136
166
|
private
|
|
137
167
|
|
|
138
168
|
def job_get_by_id: (untyped) -> untyped
|
|
@@ -142,13 +172,18 @@ module River
|
|
|
142
172
|
def runtime_cursor_clause: (untyped) -> String
|
|
143
173
|
def runtime_execute: (String) -> untyped
|
|
144
174
|
def runtime_in_clause: (untyped, untyped) -> untyped
|
|
175
|
+
def runtime_job_attempt_predicate: (untyped) -> String
|
|
145
176
|
def runtime_job_list_without_params: () -> untyped
|
|
177
|
+
def runtime_job_list: (JobListParams, ?for_delete: bool) -> Array[JobRow]
|
|
146
178
|
def runtime_job_rows: (String) -> untyped
|
|
147
179
|
def runtime_json: (untyped) -> untyped
|
|
180
|
+
def runtime_legacy_subtransactions?: () -> bool
|
|
148
181
|
def runtime_merge_metadata: (untyped) -> untyped
|
|
149
182
|
def runtime_metadata_equals: (untyped, untyped) -> untyped
|
|
150
183
|
def runtime_nullable_time: (untyped) -> untyped
|
|
151
184
|
def runtime_notify: (String, untyped) -> untyped
|
|
185
|
+
def notification_query: (String) -> untyped
|
|
186
|
+
def runtime_notification_connection: () -> untyped
|
|
152
187
|
def sqlite_insert_nonces: (Array[JobInsertParams]) -> Array[String]
|
|
153
188
|
def runtime_parse_json: (untyped) -> untyped
|
|
154
189
|
def runtime_parse_time: (untyped) -> untyped
|
|
@@ -157,11 +192,13 @@ module River
|
|
|
157
192
|
def runtime_queue_columns: () -> untyped
|
|
158
193
|
def runtime_queue_from_row: (untyped) -> untyped
|
|
159
194
|
def runtime_quote: (untyped) -> String
|
|
195
|
+
def runtime_rescue_retry: (untyped, untyped, untyped, untyped, untyped) -> Time
|
|
160
196
|
def runtime_returning_ids: (untyped) -> untyped
|
|
197
|
+
def runtime_schedule_postgres: (Time, Integer) -> Array[String]
|
|
198
|
+
def runtime_schedule_sqlite: (Time, Integer) -> Array[String]
|
|
161
199
|
def runtime_state: (untyped) -> untyped
|
|
162
200
|
def runtime_tag_contains: (untyped) -> untyped
|
|
163
201
|
def runtime_time: (untyped) -> untyped
|
|
164
|
-
def runtime_unique_violation_class: () -> singleton(Exception)
|
|
165
202
|
def runtime_update_value: (untyped, untyped) -> untyped
|
|
166
203
|
def runtime_value: (untyped, untyped) -> untyped
|
|
167
204
|
def transaction: () { () -> untyped } -> untyped
|
data/sig/insert_opts.rbs
CHANGED
|
@@ -5,11 +5,11 @@ module River
|
|
|
5
5
|
attr_accessor priority: Integer?
|
|
6
6
|
attr_accessor queue: (String | Symbol)?
|
|
7
7
|
attr_accessor scheduled_at: Time?
|
|
8
|
-
attr_accessor state:
|
|
8
|
+
attr_accessor state: jobStateInitialInput?
|
|
9
9
|
attr_accessor tags: Array[String]?
|
|
10
10
|
attr_accessor unique_opts: UniqueOpts?
|
|
11
11
|
|
|
12
|
-
def initialize: (?max_attempts: Integer?, ?metadata: Hash[String | Symbol, untyped]?, ?priority: Integer?, ?queue: (String | Symbol)?, ?scheduled_at: Time?, ?state:
|
|
12
|
+
def initialize: (?max_attempts: Integer?, ?metadata: Hash[String | Symbol, untyped]?, ?priority: Integer?, ?queue: (String | Symbol)?, ?scheduled_at: Time?, ?state: jobStateInitialInput?, ?tags: Array[String]?, ?unique_opts: UniqueOpts?) -> void
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
class UniqueOpts
|
data/sig/job.rbs
CHANGED
|
@@ -9,6 +9,8 @@ module River
|
|
|
9
9
|
JOB_STATE_SCHEDULED: "scheduled"
|
|
10
10
|
|
|
11
11
|
type jobStateAll = "available" | "cancelled" | "completed" | "discarded" | "pending" | "retryable" | "running" | "scheduled"
|
|
12
|
+
type jobStateInitial = "available" | "pending" | "scheduled"
|
|
13
|
+
type jobStateInitialInput = jobStateInitial | :available | :pending | :scheduled
|
|
12
14
|
type jobStateInput = jobStateAll | :available | :cancelled | :completed | :discarded | :pending | :retryable | :running | :scheduled
|
|
13
15
|
|
|
14
16
|
interface _JobArgs
|
data/sig/runtime.rbs
CHANGED
|
@@ -77,21 +77,32 @@ module River
|
|
|
77
77
|
@workers: Hash[String, untyped]
|
|
78
78
|
def initialize: () -> void
|
|
79
79
|
def add: (untyped, ?untyped, ?aliases: Array[untyped]) -> self
|
|
80
|
+
| (String | Symbol, ?aliases: Array[untyped]) { (Job) -> untyped } -> self
|
|
80
81
|
def []: (String | Symbol) -> untyped
|
|
81
82
|
def fetch: (String | Symbol) -> untyped
|
|
82
83
|
| (String | Symbol, untyped) -> untyped
|
|
83
84
|
| (String | Symbol) { (String) -> untyped } -> untyped
|
|
84
85
|
def include?: (String | Symbol) -> bool
|
|
85
86
|
def kinds: () -> Array[String]
|
|
87
|
+
|
|
88
|
+
class BlockWorker
|
|
89
|
+
@work_func: ^(Job) -> untyped
|
|
90
|
+
def initialize: (^(Job) -> untyped) -> void
|
|
91
|
+
def work: (Job) -> untyped
|
|
92
|
+
end
|
|
86
93
|
end
|
|
87
94
|
|
|
88
95
|
class Job
|
|
89
96
|
RESUMABLE_CURSOR_UNSET: Object
|
|
97
|
+
@__completion_attempted: bool
|
|
98
|
+
@__completion_snapshot: JobRow?
|
|
90
99
|
@client: Client
|
|
91
100
|
@logger: untyped
|
|
92
101
|
@metadata_updates: Hash[String, untyped]
|
|
93
102
|
@resumable_state: ResumableState
|
|
94
103
|
@row: JobRow
|
|
104
|
+
attr_accessor __completion_attempted: bool
|
|
105
|
+
attr_accessor __completion_snapshot: JobRow?
|
|
95
106
|
attr_reader client: Client
|
|
96
107
|
attr_reader row: JobRow
|
|
97
108
|
def initialize: (Client, JobRow) -> void
|
|
@@ -126,6 +137,7 @@ module River
|
|
|
126
137
|
attr_accessor completed_step: String?
|
|
127
138
|
attr_reader cursors: Hash[String, untyped]
|
|
128
139
|
attr_accessor cursors_dirty: bool
|
|
140
|
+
attr_reader pending_cursor_steps: Array[String]
|
|
129
141
|
attr_accessor resume_matched: bool
|
|
130
142
|
attr_reader resume_step: String?
|
|
131
143
|
attr_accessor step_name: String?
|
|
@@ -152,15 +164,30 @@ module River
|
|
|
152
164
|
def resolved_fetch_poll_interval: (Config) -> Float
|
|
153
165
|
end
|
|
154
166
|
|
|
167
|
+
class DefaultClientID
|
|
168
|
+
HOSTNAME_MAX_LENGTH: Integer
|
|
169
|
+
@mutex: Mutex
|
|
170
|
+
@state: Hash[Integer, String]?
|
|
171
|
+
def initialize: () -> void
|
|
172
|
+
def value: () -> String
|
|
173
|
+
|
|
174
|
+
private
|
|
175
|
+
|
|
176
|
+
def generate: (Integer) -> String
|
|
177
|
+
end
|
|
178
|
+
|
|
155
179
|
class Config
|
|
180
|
+
@poll_only: bool
|
|
181
|
+
attr_reader poll_only: bool
|
|
156
182
|
@cancelled_job_retention_period: Float?
|
|
157
183
|
@completed_job_retention_period: Float?
|
|
184
|
+
@default_id: DefaultClientID
|
|
158
185
|
@discarded_job_retention_period: Float?
|
|
159
186
|
@error_handler: untyped
|
|
160
187
|
@fetch_cooldown: Float
|
|
161
188
|
@fetch_only_known_kinds: bool
|
|
162
189
|
@fetch_poll_interval: Float
|
|
163
|
-
@id: String
|
|
190
|
+
@id: String?
|
|
164
191
|
@job_timeout: Float?
|
|
165
192
|
@leader_election_disabled: bool
|
|
166
193
|
@logger: untyped
|
|
@@ -178,7 +205,6 @@ module River
|
|
|
178
205
|
attr_reader fetch_cooldown: Float
|
|
179
206
|
attr_reader fetch_only_known_kinds: bool
|
|
180
207
|
attr_reader fetch_poll_interval: Float
|
|
181
|
-
attr_reader id: String
|
|
182
208
|
attr_reader job_timeout: Float?
|
|
183
209
|
attr_reader leader_election_disabled: bool
|
|
184
210
|
attr_reader logger: untyped
|
|
@@ -191,13 +217,16 @@ module River
|
|
|
191
217
|
|
|
192
218
|
def initialize: (?queues: untyped, ?workers: untyped, ?id: untyped,
|
|
193
219
|
?fetch_cooldown: untyped, ?fetch_only_known_kinds: bool, ?fetch_poll_interval: untyped, ?job_timeout: untyped,
|
|
194
|
-
?leader_election_disabled: bool,
|
|
220
|
+
?leader_election_disabled: bool, ?poll_only: bool,
|
|
195
221
|
?retry_policy: untyped, ?error_handler: untyped, ?plugins: untyped,
|
|
196
222
|
?maintenance_services: untyped, ?periodic_jobs: untyped,
|
|
197
223
|
?cancelled_job_retention_period: untyped, ?completed_job_retention_period: untyped,
|
|
198
224
|
?discarded_job_retention_period: untyped, ?logger: untyped) -> void
|
|
225
|
+
def id: () -> String
|
|
199
226
|
def with: (**untyped) -> Config
|
|
200
227
|
|
|
228
|
+
def adopt_default_id: (DefaultClientID) -> void
|
|
229
|
+
|
|
201
230
|
private
|
|
202
231
|
|
|
203
232
|
def normalize_queues: (untyped) -> Hash[String, QueueConfig]
|
|
@@ -288,8 +317,11 @@ module River
|
|
|
288
317
|
|
|
289
318
|
class PeriodicCron
|
|
290
319
|
@cron: untyped
|
|
320
|
+
@interval: Integer?
|
|
291
321
|
def initialize: (String, ?timezone: String) -> void
|
|
292
322
|
def next: (Time) -> Time
|
|
323
|
+
private
|
|
324
|
+
def parse_interval: (String) -> Integer
|
|
293
325
|
end
|
|
294
326
|
|
|
295
327
|
class PeriodicInterval
|
|
@@ -299,15 +331,18 @@ module River
|
|
|
299
331
|
end
|
|
300
332
|
|
|
301
333
|
class PeriodicJobBundle
|
|
334
|
+
@enabled: bool
|
|
302
335
|
@jobs: Hash[Integer, untyped]
|
|
303
336
|
@mutex: Mutex
|
|
304
337
|
@next_handle: Integer
|
|
305
338
|
@wake: untyped
|
|
306
|
-
def initialize: (Array[PeriodicJob], wake: untyped) -> void
|
|
339
|
+
def initialize: (Array[PeriodicJob], wake: untyped, ?enabled: bool) -> void
|
|
340
|
+
def __due_with_times: (Time) ?{ (PeriodicJob, StandardError) -> void } -> Array[[PeriodicJob, Time]]
|
|
307
341
|
def add: (PeriodicJob) -> Integer
|
|
308
342
|
def add_many: (Array[PeriodicJob]) -> Array[Integer]
|
|
309
343
|
def clear: () -> self
|
|
310
344
|
def due: (Time) ?{ (PeriodicJob, StandardError) -> void } -> Array[PeriodicJob]
|
|
345
|
+
def empty?: () -> bool
|
|
311
346
|
def remove: (Integer) -> PeriodicJob?
|
|
312
347
|
def remove_by_id: (untyped) -> bool
|
|
313
348
|
end
|
|
@@ -316,17 +351,35 @@ module River
|
|
|
316
351
|
class Interrupted < StandardError
|
|
317
352
|
end
|
|
318
353
|
|
|
354
|
+
class JobTiming
|
|
355
|
+
attr_accessor finished_monotonic: Float
|
|
356
|
+
attr_reader queue_wait_duration: Float
|
|
357
|
+
attr_reader started_at: Time
|
|
358
|
+
attr_reader started_monotonic: Float
|
|
359
|
+
|
|
360
|
+
def initialize: (Time, Float, Time) -> void
|
|
361
|
+
end
|
|
362
|
+
|
|
319
363
|
@client: Client
|
|
320
364
|
@condition: ConditionVariable
|
|
321
365
|
@config: Config
|
|
322
366
|
@driver: _Driver
|
|
367
|
+
@fetching_queues: Hash[String, Array[Integer]]
|
|
368
|
+
@leader: bool
|
|
369
|
+
@maintenance_condition: ConditionVariable
|
|
370
|
+
@maintenance_generation: Integer
|
|
323
371
|
@maintenance_thread: Thread?
|
|
324
372
|
@mutex: Mutex
|
|
325
|
-
@
|
|
373
|
+
@notification_thread: Thread?
|
|
374
|
+
@notifications_disabled: bool
|
|
326
375
|
@performing: bool?
|
|
376
|
+
@periodic_jobs: PeriodicJobBundle
|
|
327
377
|
@producer_threads: Hash[String, Thread]
|
|
328
378
|
@queue_configs: Hash[String, QueueConfig]
|
|
379
|
+
@queue_generations: Hash[String, Integer]
|
|
380
|
+
@queue_paused: Hash[String, bool]
|
|
329
381
|
@removed_queues: Hash[String, bool]
|
|
382
|
+
@resign_requested: bool
|
|
330
383
|
@running: Hash[Integer, untyped]
|
|
331
384
|
@started: bool
|
|
332
385
|
@stop_requested: bool
|
|
@@ -356,8 +409,10 @@ module River
|
|
|
356
409
|
def check_remote_cancellations: (String) -> untyped
|
|
357
410
|
def error_handler_cancel?: (Exception, Job) -> bool
|
|
358
411
|
def execute: (JobRow) -> untyped
|
|
359
|
-
def finish_failed: (JobRow, Job, Exception,
|
|
360
|
-
def
|
|
412
|
+
def finish_failed: (JobRow, Job, Exception, JobTiming, ?cancelled: bool, ?worker: untyped) -> untyped
|
|
413
|
+
def finish_interrupted: (JobRow, Job, JobTiming) -> untyped
|
|
414
|
+
def finish_snoozed: (JobRow, Job, JobSnoozeError, JobTiming) -> untyped
|
|
415
|
+
def finish_transactional_completion: (Job, JobTiming) -> bool
|
|
361
416
|
def finish_work: (Integer) -> untyped
|
|
362
417
|
def invoke_plugins: (Symbol, *untyped) -> Array[untyped]
|
|
363
418
|
def invoke_worker: (untyped, Job) -> untyped
|
|
@@ -365,18 +420,31 @@ module River
|
|
|
365
420
|
def maintenance_loop: () -> untyped
|
|
366
421
|
def monotonic_now: () -> Float
|
|
367
422
|
def next_retry: (JobRow, Exception, Time, ?worker: untyped) -> Time
|
|
423
|
+
def next_snooze_count: (untyped) -> Integer
|
|
424
|
+
def notification_loop: (untyped) -> untyped
|
|
425
|
+
def notifications_stopping?: () -> bool
|
|
368
426
|
def retry_allowed?: (untyped, Job, Exception) -> untyped
|
|
369
427
|
def perform_work: (untyped, Job) -> untyped
|
|
428
|
+
def periodic_jobs_changed: () -> untyped
|
|
370
429
|
def producer_loop: (String, QueueConfig) -> untyped
|
|
371
|
-
def publish: (Symbol, JobRow,
|
|
430
|
+
def publish: (Symbol, JobRow, JobTiming) -> untyped
|
|
372
431
|
def queue_stopping?: (String) -> bool
|
|
432
|
+
def receive_notification: (untyped, untyped) -> untyped
|
|
373
433
|
def remove_subscription: (Subscription) -> Subscription?
|
|
434
|
+
def rescue_job?: (JobRow, Time) -> bool
|
|
374
435
|
def resolve_worker: (String) -> untyped
|
|
375
436
|
def run_periodic: (Time) -> untyped
|
|
376
437
|
def running_count: (String) -> Integer
|
|
377
438
|
def start_maintenance: () -> untyped
|
|
439
|
+
def start_notifications: () -> untyped
|
|
378
440
|
def start_producer: (String, QueueConfig) -> untyped
|
|
379
441
|
def stopping?: () -> bool
|
|
380
442
|
def wait: (Float | Integer) -> untyped
|
|
443
|
+
def wait_for_maintenance: (Float | Integer, Integer) -> untyped
|
|
444
|
+
def wait_for_queue: (String, Float | Integer, Integer) -> untyped
|
|
445
|
+
def wait_for_running_jobs: (String, Float | Integer) -> untyped
|
|
446
|
+
def wake_maintenance: () -> untyped
|
|
447
|
+
def wake_queue: (String) -> untyped
|
|
448
|
+
def worker_timeout: (untyped, Job) -> Float?
|
|
381
449
|
end
|
|
382
450
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: riverqueue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Blake Gentry
|
|
@@ -91,7 +91,7 @@ dependencies:
|
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
92
|
version: '1000'
|
|
93
93
|
description: Insert and work River jobs in Ruby using the same schema and state machine
|
|
94
|
-
as River
|
|
94
|
+
as other River clients. Use with riverqueue-activerecord or riverqueue-sequel.
|
|
95
95
|
email: brandur@brandur.org
|
|
96
96
|
executables:
|
|
97
97
|
- river
|
|
@@ -100,7 +100,9 @@ extra_rdoc_files: []
|
|
|
100
100
|
files:
|
|
101
101
|
- CHANGELOG.md
|
|
102
102
|
- LICENSE
|
|
103
|
+
- README.md
|
|
103
104
|
- docs/README.md
|
|
105
|
+
- docs/conformance.md
|
|
104
106
|
- docs/migrations.md
|
|
105
107
|
- docs/testing.md
|
|
106
108
|
- docs/workers.md
|
|
@@ -111,6 +113,7 @@ files:
|
|
|
111
113
|
- lib/config.rb
|
|
112
114
|
- lib/driver.rb
|
|
113
115
|
- lib/driver/job_row_decoder.rb
|
|
116
|
+
- lib/driver/notification_listener.rb
|
|
114
117
|
- lib/driver/postgres_capabilities.rb
|
|
115
118
|
- lib/driver/runtime.rb
|
|
116
119
|
- lib/errors.rb
|
|
@@ -183,10 +186,10 @@ homepage: https://riverqueue.com
|
|
|
183
186
|
licenses:
|
|
184
187
|
- MPL-2.0
|
|
185
188
|
metadata:
|
|
186
|
-
bug_tracker_uri: https://github.com/riverqueue/
|
|
187
|
-
changelog_uri: https://github.com/riverqueue/
|
|
189
|
+
bug_tracker_uri: https://github.com/riverqueue/river/issues
|
|
190
|
+
changelog_uri: https://github.com/riverqueue/river/blob/master/ruby/CHANGELOG.md
|
|
188
191
|
rubygems_mfa_required: 'true'
|
|
189
|
-
source_code_uri: https://github.com/riverqueue/
|
|
192
|
+
source_code_uri: https://github.com/riverqueue/river/tree/master/ruby
|
|
190
193
|
rdoc_options: []
|
|
191
194
|
require_paths:
|
|
192
195
|
- lib
|
|
@@ -203,5 +206,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
203
206
|
requirements: []
|
|
204
207
|
rubygems_version: 4.0.9
|
|
205
208
|
specification_version: 4
|
|
206
|
-
summary: A fast, reliable job queue for Ruby backed by
|
|
209
|
+
summary: A fast, reliable job queue for Ruby backed by Postgres or SQLite.
|
|
207
210
|
test_files: []
|