Releases: janbjorge/pgqueuer
v0.16.1
What's Changed
- Update docs. by @janbjorge in #199
- Add test_execute_after_updated_gt_execute_after by @janbjorge in #200
- Task manager check task cancelled upon completed by @janbjorge in #203
- Dynamic import add current working directory to sys-path by @janbjorge in #204
Full Changelog: v0.16.0...v0.16.1
v0.16.0
PGQueuer v0.16.0 Release Notes
Release of v0.16.0, bringing new capability: deferred job execution for more precise control over job timing.
Breaking Changes / Migration Notes
- Database Schema Update: The
Job
model now includes a newexecute_after
column. This change requires a database schema update. To apply the necessary migration, please run:
python -m pgqueuer upgrade
Failing to apply this migration will result in errors when trying to enqueue jobs with the new execute_after
attribute.
What's Changed
- Add dataclass dec. to job executor by @janbjorge in #194
- Refactor verify structure by @janbjorge in #196
- Add execute after feature by @janbjorge in #195.
Example Usage
To enqueue a job for deferred execution until 1 minute from now:
from datetime import timedelta
await Queries(apgdriver).enqueue("my_task", payload=None, priority=0, execute_after=timedelta(minutes=1))
This job will only be picked for execution once the specified minute has elapsed, giving you better control over job timing.
Full Changelog: v0.15.0...v0.16.0
v0.15.0
PGQueuer v0.15.0 Release Notes
Im excited to introduce a new features and enhancements in this release; support for scheduling recurring jobs using cron-like syntax.
What's Changed
- Public Interfaces Defined: Updated
__init__.py
to define public interfaces more clearly (#186). - Scheduling with Crontab Syntax: You can now schedule functions using cron-like expressions for periodic task execution (#188).
- Added SchedulerManager to Public API: Included
SchedulerManager
in__init__.py
for easy access (#191). - Added Scheduler Example to README: Enhanced documentation with examples on using the new scheduling feature (#190).
- Batch RPS Events: Implemented batching to improve the handling of rate-per-second (RPS) events (#192).
Note: In order to use the new scheduling feature, a migration step is required. Please run:
python -m pgqueuer upgrade
Example Usage
To schedule a recurring task every minute:
@scheduler.schedule("sync_data", "* * * * *")
async def sync_data(schedule: Schedule) -> None:
print("Running scheduled sync_data task")
Run the scheduler using the CLI:
pgq run myapp.create_scheduler
Full Changelog: v0.14.1...v0.15.0
v0.14.1
What's Changed
- Minor readme update by @janbjorge in #179
- Add tooling concurrency-probe by @janbjorge in #180
- Switch to utc_now() for consistent timing across multiple processes by @janbjorge in #182
- CLI listen broken by @janbjorge in #183
- Use buffer for RPS by @janbjorge in #181
- Refactor listener setup by @janbjorge in #184
Full Changelog: v0.14.0...v0.14.1
v0.14.0
Breaking Change
This release introduces a new database schema. Before deploying this version, ensure your database schema is updated by running the following command:
python -m pgqueuer upgrade
This step is essential for compatibility with new features, including schema modifications related to job management.
What's Changed
- PsycopgDriver Fix: Corrected missing inheritance for
PsycopgDriver
, enhancing type compatibility and functionality. #169 - Renamed
alive
toshutdown
: Updated thealive
attribute toshutdown
to better reflect its purpose across the codebase. Backwards compatibility maintained with a deprecation warning. #168 - Exponential Backoff with Jitter: Added exponential backoff with jitter for deadlock mitigation, improving job processing resilience in high-concurrency environments. #171
- Queue Manager ID Column: Introduced a
queue_manager_id
column to support isolated queue management and improved tracking across multiple managers. #175 alive
Property Deprecation: Issued a deprecation warning on thealive
property to encourage migration toshutdown
. #176- Async Generator for Job Dequeuing: Refactored job dequeuing logic into an async generator, enhancing efficiency and readability. #174
Full Changelog: v0.13.0...v0.14.0
v0.13.0
What's Changed
- fix: dashboard show
Created
in user timezone by @trim21 in #160 - Add doc-string retry_timer_buffer_timeout by @janbjorge in #161
- Add pgq cli script by @janbjorge in #164
- Update cli docs by @janbjorge in #165
- Updated readme by @janbjorge in #166
New Contributors
Full Changelog: v0.12.0...v0.13.0
v0.12.0
v0.11.0
What's Changed
- Use uv in github actions by @janbjorge in #147
- Number of consumers in test_serialized_dispatch_mixed must be gt. 1 by @janbjorge in #148
- Add sleep ci job by @janbjorge in #150
- Add executor to entrypoint fn by @janbjorge in #155
- Cleanup a few code smells by @janbjorge in #158
Full Changelog: v0.10.0...v0.11.0
v0.10.0
Im excited to announce Serialized Dispatch for PGQueuer!
Serialized Dispatch ensures jobs of the same type are processed one at a time, perfect for avoiding race conditions when modifying shared resources.
Example
Define an entrypoint with Serialized Dispatch:
@qm.entrypoint("data_processing", serialized_dispatch=True)
async def data_processing(job):
# Job processing logic
...
This ensures only one data_processing
job runs at a time, avoiding concurrent modifications.
Other changes
- Add validate benchmark ci test by @janbjorge in #137
- Update ci.yml by @janbjorge in #138
- Delete tools/compare_rps_main.py by @janbjorge in #139
- Add ci schedule by @janbjorge in #140
- Add serialized dispatch by @janbjorge in #136
Full Changelog: v0.9.2...v0.10.0