queuerPy 0.16.0__tar.gz → 0.17.0__tar.gz

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 (52) hide show
  1. {queuerpy-0.16.0/queuerPy.egg-info → queuerpy-0.17.0}/PKG-INFO +82 -7
  2. {queuerpy-0.16.0 → queuerpy-0.17.0}/README.md +81 -6
  3. {queuerpy-0.16.0 → queuerpy-0.17.0}/_version.py +1 -1
  4. {queuerpy-0.16.0 → queuerpy-0.17.0}/pyproject.toml +2 -2
  5. {queuerpy-0.16.0 → queuerpy-0.17.0/queuerPy.egg-info}/PKG-INFO +82 -7
  6. {queuerpy-0.16.0 → queuerpy-0.17.0}/LICENSE +0 -0
  7. {queuerpy-0.16.0 → queuerpy-0.17.0}/MANIFEST.in +0 -0
  8. {queuerpy-0.16.0 → queuerpy-0.17.0}/__init__.py +0 -0
  9. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/__init__.py +0 -0
  10. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/broadcaster.py +0 -0
  11. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/listener.py +0 -0
  12. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/retryer.py +0 -0
  13. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/runner.py +0 -0
  14. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/scheduler.py +0 -0
  15. {queuerpy-0.16.0 → queuerpy-0.17.0}/core/ticker.py +0 -0
  16. {queuerpy-0.16.0 → queuerpy-0.17.0}/database/__init__.py +0 -0
  17. {queuerpy-0.16.0 → queuerpy-0.17.0}/database/db_job.py +0 -0
  18. {queuerpy-0.16.0 → queuerpy-0.17.0}/database/db_listener.py +0 -0
  19. {queuerpy-0.16.0 → queuerpy-0.17.0}/database/db_master.py +0 -0
  20. {queuerpy-0.16.0 → queuerpy-0.17.0}/database/db_worker.py +0 -0
  21. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/__init__.py +0 -0
  22. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/database.py +0 -0
  23. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/error.py +0 -0
  24. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/logging.py +0 -0
  25. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/sql.py +0 -0
  26. {queuerpy-0.16.0 → queuerpy-0.17.0}/helper/task.py +0 -0
  27. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/__init__.py +0 -0
  28. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/batch_job.py +0 -0
  29. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/connection.py +0 -0
  30. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/job.py +0 -0
  31. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/master.py +0 -0
  32. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/options.py +0 -0
  33. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/options_on_error.py +0 -0
  34. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/task.py +0 -0
  35. {queuerpy-0.16.0 → queuerpy-0.17.0}/model/worker.py +0 -0
  36. {queuerpy-0.16.0 → queuerpy-0.17.0}/py.typed +0 -0
  37. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer.py +0 -0
  38. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuerPy.egg-info/SOURCES.txt +0 -0
  39. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuerPy.egg-info/dependency_links.txt +0 -0
  40. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuerPy.egg-info/requires.txt +0 -0
  41. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuerPy.egg-info/top_level.txt +0 -0
  42. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_global.py +0 -0
  43. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_job.py +0 -0
  44. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_listener.py +0 -0
  45. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_master.py +0 -0
  46. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_next_interval.py +0 -0
  47. {queuerpy-0.16.0 → queuerpy-0.17.0}/queuer_task.py +0 -0
  48. {queuerpy-0.16.0 → queuerpy-0.17.0}/setup.cfg +0 -0
  49. {queuerpy-0.16.0 → queuerpy-0.17.0}/sql/job.sql +0 -0
  50. {queuerpy-0.16.0 → queuerpy-0.17.0}/sql/master.sql +0 -0
  51. {queuerpy-0.16.0 → queuerpy-0.17.0}/sql/notify.sql +0 -0
  52. {queuerpy-0.16.0 → queuerpy-0.17.0}/sql/worker.sql +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: queuerPy
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend
5
5
  Author-email: Simon Herrmann <siherrmann@users.noreply.github.com>
6
6
  Maintainer-email: Simon Herrmann <siherrmann@users.noreply.github.com>
@@ -43,9 +43,10 @@ Dynamic: license-file
43
43
 
44
44
  # queuerPy
45
45
 
46
+ [![PyPi](https://pythonico.leapcell.app/pypi/queuerPy.svg?style=shields&data=n,v,d)](https://pypi.org/project/queuerPy/)
46
47
  [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://www.python.org/)
47
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
48
48
  ![Coverage](https://raw.githubusercontent.com/siherrmann/queuerPy/refs/heads/main/coverage-badge.svg)
49
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
49
50
 
50
51
  Python port of the queuer package - a queueing system based on PostgreSQL.
51
52
 
@@ -97,9 +98,15 @@ def example_task():
97
98
  That's easy, right? Adding a job is just as easy:
98
99
 
99
100
  ```python
100
- # Add a job to the queue
101
+ # Add a job to the queue with positional arguments
101
102
  job = q.add_job(example_task, 5, "12")
102
103
  print(f"Job added: {job.rid}")
104
+
105
+ # Add a job with keyword arguments (kwargs)
106
+ job = q.add_job(example_task, paramKeyed1="test", debug=True)
107
+
108
+ # Add a job with both positional and keyword arguments
109
+ job = q.add_job(example_task, 5, "12", paramKeyed1="test", debug=True)
103
110
  ```
104
111
 
105
112
  In the initialisation of the queuer the existence of the necessary database tables is checked and if they don't exist they get created. The database is configured with these environment variables:
@@ -199,6 +206,72 @@ This method handles the registration of a task, making the worker able to pick u
199
206
 
200
207
  ---
201
208
 
209
+ ## add_job
210
+
211
+ The `add_job` method adds a new job to the queue for execution. Jobs are units of work that will be processed by the queuer.
212
+
213
+ ```python
214
+ def add_job(
215
+ self,
216
+ task: Union[Callable, str],
217
+ *parameters: Any,
218
+ **parameters_keyed: Any
219
+ ) -> Job
220
+
221
+ def add_job_with_options(
222
+ self,
223
+ options: Optional[Options],
224
+ task: Union[Callable, str],
225
+ *parameters: Any,
226
+ **parameters_keyed: Any
227
+ ) -> Job
228
+ ```
229
+
230
+ - `task`: A `Callable` or `str` representing the task to execute. If a callable, it must be registered with `add_task` first.
231
+ - `options`: Optional `Options` for custom error handling or scheduling behavior. Only available in `add_job_with_options()`.
232
+ - `*parameters`: Positional arguments to pass to the task function.
233
+ - `**parameters_keyed`: Keyword arguments to pass to the task function (Python-specific feature).
234
+
235
+ **Examples:**
236
+
237
+ ```python
238
+ # Job with both positional and keyword arguments
239
+ job = queuer.add_job(my_task, "arg1", paramKeyed1="test", paramKeyed2=1)
240
+
241
+ # Job with custom options (requires add_job_with_options)
242
+ options = Options(on_error=OnError(max_retries=5))
243
+ job = queuer.add_job_with_options(options, my_task, "arg1", debug=True)
244
+ ```
245
+
246
+ **Note:** Keyword arguments (`**parameters_keyed`) are stored separately in the database and enable Python functions to be called with named parameters. This is useful for optional parameters, default values, and improved code clarity. Go jobs continue to use only positional parameters.
247
+
248
+ ---
249
+
250
+ ## add_jobs
251
+
252
+ The `add_jobs` method allows efficient batch insertion of multiple jobs at once.
253
+
254
+ ```python
255
+ def add_jobs(self, batch_jobs: List[BatchJob]) -> List[UUID]
256
+ ```
257
+
258
+ - `batch_jobs`: A list of `BatchJob` instances to insert.
259
+
260
+ **Example:**
261
+
262
+ ```python
263
+ from model.batch_job import BatchJob
264
+
265
+ batch = [
266
+ BatchJob(task=my_task, parameters=[1, "a"]),
267
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
268
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
269
+ ]
270
+ job_rids = queuer.add_jobs(batch)
271
+ ```
272
+
273
+ ---
274
+
202
275
  ## add_next_interval_func
203
276
 
204
277
  The `add_next_interval_func` method registers a custom function that determines the next execution time for scheduled jobs. This is useful for implementing complex scheduling logic beyond simple fixed intervals.
@@ -296,19 +369,20 @@ class Schedule:
296
369
  ### Job Management
297
370
 
298
371
  ```python
299
- # Add a single job
300
- job = queuer.add_job(my_task, param1, param2)
372
+ # Add a job with both positional and keyword arguments
373
+ job = queuer.add_job(my_task, param1, param2, paramKeyed1="test", paramKeyed2=1)
301
374
 
302
375
  # Add a job with custom options
303
376
  from model.options import Options, OnError
304
377
  options = Options(on_error=OnError(max_retries=5, timeout=60.0))
305
- job = queuer.add_job_with_options(options, my_task, param1)
378
+ job = queuer.add_job_with_options(options, my_task, param1, paramKeyed1="test")
306
379
 
307
380
  # Add multiple jobs as a batch
308
381
  from model.batch_job import BatchJob
309
382
  batch = [
310
383
  BatchJob(task=my_task, parameters=[1, "a"]),
311
- BatchJob(task=my_task, parameters=[2, "b"])
384
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
385
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
312
386
  ]
313
387
  queuer.add_jobs(batch)
314
388
 
@@ -335,6 +409,7 @@ worker_jobs = queuer.get_jobs_by_worker_rid(worker.rid)
335
409
 
336
410
  # ⭐ Features
337
411
 
412
+ - **Keyword Arguments Support**: Python functions can use both positional arguments (`*args`) and keyword arguments (`**kwargs`), while maintaining compatibility with Go jobs that use only positional parameters.
338
413
  - **Async/Await Support**: Full asyncio integration with threading fallbacks.
339
414
  - **PostgreSQL NOTIFY/LISTEN**: Real-time job notifications without polling overhead.
340
415
  - **Batch Job Processing**: Insert job batches efficiently using PostgreSQL's `COPY FROM` feature.
@@ -1,8 +1,9 @@
1
1
  # queuerPy
2
2
 
3
+ [![PyPi](https://pythonico.leapcell.app/pypi/queuerPy.svg?style=shields&data=n,v,d)](https://pypi.org/project/queuerPy/)
3
4
  [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://www.python.org/)
4
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
5
5
  ![Coverage](https://raw.githubusercontent.com/siherrmann/queuerPy/refs/heads/main/coverage-badge.svg)
6
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
6
7
 
7
8
  Python port of the queuer package - a queueing system based on PostgreSQL.
8
9
 
@@ -54,9 +55,15 @@ def example_task():
54
55
  That's easy, right? Adding a job is just as easy:
55
56
 
56
57
  ```python
57
- # Add a job to the queue
58
+ # Add a job to the queue with positional arguments
58
59
  job = q.add_job(example_task, 5, "12")
59
60
  print(f"Job added: {job.rid}")
61
+
62
+ # Add a job with keyword arguments (kwargs)
63
+ job = q.add_job(example_task, paramKeyed1="test", debug=True)
64
+
65
+ # Add a job with both positional and keyword arguments
66
+ job = q.add_job(example_task, 5, "12", paramKeyed1="test", debug=True)
60
67
  ```
61
68
 
62
69
  In the initialisation of the queuer the existence of the necessary database tables is checked and if they don't exist they get created. The database is configured with these environment variables:
@@ -156,6 +163,72 @@ This method handles the registration of a task, making the worker able to pick u
156
163
 
157
164
  ---
158
165
 
166
+ ## add_job
167
+
168
+ The `add_job` method adds a new job to the queue for execution. Jobs are units of work that will be processed by the queuer.
169
+
170
+ ```python
171
+ def add_job(
172
+ self,
173
+ task: Union[Callable, str],
174
+ *parameters: Any,
175
+ **parameters_keyed: Any
176
+ ) -> Job
177
+
178
+ def add_job_with_options(
179
+ self,
180
+ options: Optional[Options],
181
+ task: Union[Callable, str],
182
+ *parameters: Any,
183
+ **parameters_keyed: Any
184
+ ) -> Job
185
+ ```
186
+
187
+ - `task`: A `Callable` or `str` representing the task to execute. If a callable, it must be registered with `add_task` first.
188
+ - `options`: Optional `Options` for custom error handling or scheduling behavior. Only available in `add_job_with_options()`.
189
+ - `*parameters`: Positional arguments to pass to the task function.
190
+ - `**parameters_keyed`: Keyword arguments to pass to the task function (Python-specific feature).
191
+
192
+ **Examples:**
193
+
194
+ ```python
195
+ # Job with both positional and keyword arguments
196
+ job = queuer.add_job(my_task, "arg1", paramKeyed1="test", paramKeyed2=1)
197
+
198
+ # Job with custom options (requires add_job_with_options)
199
+ options = Options(on_error=OnError(max_retries=5))
200
+ job = queuer.add_job_with_options(options, my_task, "arg1", debug=True)
201
+ ```
202
+
203
+ **Note:** Keyword arguments (`**parameters_keyed`) are stored separately in the database and enable Python functions to be called with named parameters. This is useful for optional parameters, default values, and improved code clarity. Go jobs continue to use only positional parameters.
204
+
205
+ ---
206
+
207
+ ## add_jobs
208
+
209
+ The `add_jobs` method allows efficient batch insertion of multiple jobs at once.
210
+
211
+ ```python
212
+ def add_jobs(self, batch_jobs: List[BatchJob]) -> List[UUID]
213
+ ```
214
+
215
+ - `batch_jobs`: A list of `BatchJob` instances to insert.
216
+
217
+ **Example:**
218
+
219
+ ```python
220
+ from model.batch_job import BatchJob
221
+
222
+ batch = [
223
+ BatchJob(task=my_task, parameters=[1, "a"]),
224
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
225
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
226
+ ]
227
+ job_rids = queuer.add_jobs(batch)
228
+ ```
229
+
230
+ ---
231
+
159
232
  ## add_next_interval_func
160
233
 
161
234
  The `add_next_interval_func` method registers a custom function that determines the next execution time for scheduled jobs. This is useful for implementing complex scheduling logic beyond simple fixed intervals.
@@ -253,19 +326,20 @@ class Schedule:
253
326
  ### Job Management
254
327
 
255
328
  ```python
256
- # Add a single job
257
- job = queuer.add_job(my_task, param1, param2)
329
+ # Add a job with both positional and keyword arguments
330
+ job = queuer.add_job(my_task, param1, param2, paramKeyed1="test", paramKeyed2=1)
258
331
 
259
332
  # Add a job with custom options
260
333
  from model.options import Options, OnError
261
334
  options = Options(on_error=OnError(max_retries=5, timeout=60.0))
262
- job = queuer.add_job_with_options(options, my_task, param1)
335
+ job = queuer.add_job_with_options(options, my_task, param1, paramKeyed1="test")
263
336
 
264
337
  # Add multiple jobs as a batch
265
338
  from model.batch_job import BatchJob
266
339
  batch = [
267
340
  BatchJob(task=my_task, parameters=[1, "a"]),
268
- BatchJob(task=my_task, parameters=[2, "b"])
341
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
342
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
269
343
  ]
270
344
  queuer.add_jobs(batch)
271
345
 
@@ -292,6 +366,7 @@ worker_jobs = queuer.get_jobs_by_worker_rid(worker.rid)
292
366
 
293
367
  # ⭐ Features
294
368
 
369
+ - **Keyword Arguments Support**: Python functions can use both positional arguments (`*args`) and keyword arguments (`**kwargs`), while maintaining compatibility with Go jobs that use only positional parameters.
295
370
  - **Async/Await Support**: Full asyncio integration with threading fallbacks.
296
371
  - **PostgreSQL NOTIFY/LISTEN**: Real-time job notifications without polling overhead.
297
372
  - **Batch Job Processing**: Insert job batches efficiently using PostgreSQL's `COPY FROM` feature.
@@ -1,6 +1,6 @@
1
1
  """Version information for queuerPy package."""
2
2
 
3
- __version__ = "0.16.0"
3
+ __version__ = "0.17.0"
4
4
  __version_info__ = tuple(int(part) for part in __version__.split("."))
5
5
 
6
6
  # For compatibility
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "queuerPy"
7
- version = "0.16.0"
7
+ version = "0.17.0"
8
8
  description = "A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -92,7 +92,7 @@ pythonVersion = "3.8"
92
92
  pythonPlatform = "All"
93
93
 
94
94
  [tool.mypy]
95
- python_version = "0.16.0"
95
+ python_version = "0.17.0"
96
96
  warn_return_any = true
97
97
  warn_unused_configs = true
98
98
  disallow_untyped_defs = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: queuerPy
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: A Python implementation of the queuer system - a job queuing and processing system with PostgreSQL backend
5
5
  Author-email: Simon Herrmann <siherrmann@users.noreply.github.com>
6
6
  Maintainer-email: Simon Herrmann <siherrmann@users.noreply.github.com>
@@ -43,9 +43,10 @@ Dynamic: license-file
43
43
 
44
44
  # queuerPy
45
45
 
46
+ [![PyPi](https://pythonico.leapcell.app/pypi/queuerPy.svg?style=shields&data=n,v,d)](https://pypi.org/project/queuerPy/)
46
47
  [![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://www.python.org/)
47
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
48
48
  ![Coverage](https://raw.githubusercontent.com/siherrmann/queuerPy/refs/heads/main/coverage-badge.svg)
49
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/siherrmann/queuer/blob/master/LICENSE)
49
50
 
50
51
  Python port of the queuer package - a queueing system based on PostgreSQL.
51
52
 
@@ -97,9 +98,15 @@ def example_task():
97
98
  That's easy, right? Adding a job is just as easy:
98
99
 
99
100
  ```python
100
- # Add a job to the queue
101
+ # Add a job to the queue with positional arguments
101
102
  job = q.add_job(example_task, 5, "12")
102
103
  print(f"Job added: {job.rid}")
104
+
105
+ # Add a job with keyword arguments (kwargs)
106
+ job = q.add_job(example_task, paramKeyed1="test", debug=True)
107
+
108
+ # Add a job with both positional and keyword arguments
109
+ job = q.add_job(example_task, 5, "12", paramKeyed1="test", debug=True)
103
110
  ```
104
111
 
105
112
  In the initialisation of the queuer the existence of the necessary database tables is checked and if they don't exist they get created. The database is configured with these environment variables:
@@ -199,6 +206,72 @@ This method handles the registration of a task, making the worker able to pick u
199
206
 
200
207
  ---
201
208
 
209
+ ## add_job
210
+
211
+ The `add_job` method adds a new job to the queue for execution. Jobs are units of work that will be processed by the queuer.
212
+
213
+ ```python
214
+ def add_job(
215
+ self,
216
+ task: Union[Callable, str],
217
+ *parameters: Any,
218
+ **parameters_keyed: Any
219
+ ) -> Job
220
+
221
+ def add_job_with_options(
222
+ self,
223
+ options: Optional[Options],
224
+ task: Union[Callable, str],
225
+ *parameters: Any,
226
+ **parameters_keyed: Any
227
+ ) -> Job
228
+ ```
229
+
230
+ - `task`: A `Callable` or `str` representing the task to execute. If a callable, it must be registered with `add_task` first.
231
+ - `options`: Optional `Options` for custom error handling or scheduling behavior. Only available in `add_job_with_options()`.
232
+ - `*parameters`: Positional arguments to pass to the task function.
233
+ - `**parameters_keyed`: Keyword arguments to pass to the task function (Python-specific feature).
234
+
235
+ **Examples:**
236
+
237
+ ```python
238
+ # Job with both positional and keyword arguments
239
+ job = queuer.add_job(my_task, "arg1", paramKeyed1="test", paramKeyed2=1)
240
+
241
+ # Job with custom options (requires add_job_with_options)
242
+ options = Options(on_error=OnError(max_retries=5))
243
+ job = queuer.add_job_with_options(options, my_task, "arg1", debug=True)
244
+ ```
245
+
246
+ **Note:** Keyword arguments (`**parameters_keyed`) are stored separately in the database and enable Python functions to be called with named parameters. This is useful for optional parameters, default values, and improved code clarity. Go jobs continue to use only positional parameters.
247
+
248
+ ---
249
+
250
+ ## add_jobs
251
+
252
+ The `add_jobs` method allows efficient batch insertion of multiple jobs at once.
253
+
254
+ ```python
255
+ def add_jobs(self, batch_jobs: List[BatchJob]) -> List[UUID]
256
+ ```
257
+
258
+ - `batch_jobs`: A list of `BatchJob` instances to insert.
259
+
260
+ **Example:**
261
+
262
+ ```python
263
+ from model.batch_job import BatchJob
264
+
265
+ batch = [
266
+ BatchJob(task=my_task, parameters=[1, "a"]),
267
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
268
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
269
+ ]
270
+ job_rids = queuer.add_jobs(batch)
271
+ ```
272
+
273
+ ---
274
+
202
275
  ## add_next_interval_func
203
276
 
204
277
  The `add_next_interval_func` method registers a custom function that determines the next execution time for scheduled jobs. This is useful for implementing complex scheduling logic beyond simple fixed intervals.
@@ -296,19 +369,20 @@ class Schedule:
296
369
  ### Job Management
297
370
 
298
371
  ```python
299
- # Add a single job
300
- job = queuer.add_job(my_task, param1, param2)
372
+ # Add a job with both positional and keyword arguments
373
+ job = queuer.add_job(my_task, param1, param2, paramKeyed1="test", paramKeyed2=1)
301
374
 
302
375
  # Add a job with custom options
303
376
  from model.options import Options, OnError
304
377
  options = Options(on_error=OnError(max_retries=5, timeout=60.0))
305
- job = queuer.add_job_with_options(options, my_task, param1)
378
+ job = queuer.add_job_with_options(options, my_task, param1, paramKeyed1="test")
306
379
 
307
380
  # Add multiple jobs as a batch
308
381
  from model.batch_job import BatchJob
309
382
  batch = [
310
383
  BatchJob(task=my_task, parameters=[1, "a"]),
311
- BatchJob(task=my_task, parameters=[2, "b"])
384
+ BatchJob(task=my_task, parameters=[2], parameters_keyed={"name": "b"}),
385
+ BatchJob(task=my_task, parameters_keyed={"id": 3, "name": "c"})
312
386
  ]
313
387
  queuer.add_jobs(batch)
314
388
 
@@ -335,6 +409,7 @@ worker_jobs = queuer.get_jobs_by_worker_rid(worker.rid)
335
409
 
336
410
  # ⭐ Features
337
411
 
412
+ - **Keyword Arguments Support**: Python functions can use both positional arguments (`*args`) and keyword arguments (`**kwargs`), while maintaining compatibility with Go jobs that use only positional parameters.
338
413
  - **Async/Await Support**: Full asyncio integration with threading fallbacks.
339
414
  - **PostgreSQL NOTIFY/LISTEN**: Real-time job notifications without polling overhead.
340
415
  - **Batch Job Processing**: Insert job batches efficiently using PostgreSQL's `COPY FROM` feature.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes