Releases: TkTech/chancy
Releases · TkTech/chancy
v0.25.0
0.25.0
🚨 This release requires that you run migrations, as it adds a new queue
setting, eager_polling
. Call chancy.migrate()
or use the CLI:
chancy --app <your app> misc migrate
✨ Improvements
Chancy.wait_for_job()
now accepts a list of states to wait for, so you can
use it to wait for a job to begin running, retried, etc... instead of just
finished.Reference()
objects are now hashable and have equality.Chancy.wait_for_jobs()
added to wait for multiple jobs to finish.Chancy.get_jobs()
added to fetch multiple jobs by ID in a single query.- Added the
eager_polling
option toQueue
to trigger immediate polling
whenever an executor slot becomes free. This is useful for low-latency
processing of jobs with low concurrency, but may increase database load (#48)
🐛 Fixes
- Fixed a bug where a job with a unique_key could run multiple times if
pushed again after the job had started running (#51), reported by @mrsshr. - Remove an unused plugin hook
on_worker_started
, which is available via
theworker.started
event anyway (#47) by @PaulM5406.
v0.24.3
v0.24.2
v0.24.1
v0.24.0
📝 Documentation
- Correction to the cron plugin example (Thanks @PaulM5406)
🐛 Fixes
- Fix for
sync_push_many_ex
using index access for columns instead of key
by @nico-deforge. - Fixed a deprecated usage of
ConnectionPool()
with an implicitopen=True
. - Fixed the
queue.pushed
event not waking up a worker waiting for jobs.
✨ Improvements
- Exposed the
created_at
field on a QueuedJob record by @PaulM5406. - Erase the cached psycopg pool connection when the context manager is closed
to support multiple connects and disconnects. - Added
Chancy.sync_declare()
,Chancy.sync_declare_ex()
and
Chancy.sync_get_job
. - Jobs are now naturally fetched oldest to newest due to the nature of the
UUID7s that are used for the job IDs. Job features like priority may affect
this ordering. - Added the
worker.queue.full
event to notify when a queue's polling event
ran, but was unable to start any jobs due to the executor being full. - If a queue pulled its maximum number of jobs, it'll immediately re-poll for
more, as it's unlikely that the queue is now empty.
v0.23.3
v0.23.1
v0.23.0
- Support for django-style database settings as the first argument to the
Chancy
constructor to ease integration with Django projects. - Chancy's dashboard and API now require a login by default. If the CLI is
used to start the dashboard without an API configured, a random temporary
password will be generated. Authentication backends are pluggable, and Chancy
comes with an optional DjangoAuthBackend. - The dashboard's live event stream is temporarily removed due to Websocket
routes not properly supporting authentication. - Many documentation tweaks
v0.22.0
This release requires that you run migrations, as it converts all JSON columns
to JSONB. Call chancy.migrate()
or use the CLI:
chancy --app <your app> misc migrate
- Chancy now starts some default plugins with reasonable defaults if they are
not configured. This includes theMetrics
,Leadership
,Pruner
,
Recovery
andWorkflowPlugin
. - Queue's now support a
resume_at
option, which allows them to automatically
go active after the specified time. This can be used to implement circuit
breakers. - Added the convenience functions
Chancy.pause_queue()
and
Chancy.resume_queue()
. Calling this functions will emitqueue.paused
and
queue.resumed
events. - Plugins must now provide a
get_identifier()
method, which should return a
unique identifier for the plugin. - Plugins may now implement
get_depdenencies()
to return a list of other
plugins that they depend on. - The default queue polling interval for new queues has been increased from
1 to 5 seconds. - All JSON columns have been converted to JSONB, which is more efficient and
allows for indexing, and is supported by Django's JSONField type.
Metrics Plugin
- Internal implementation of the Metrics plugin has been significantly
simplified. - Metrics plugin now tracks job completion status on a per-queue basis as well
as globally, which allows for the implementation of global, per-queue circuit
breaker logic.
Django
- Chancy now comes with a Django app that gives you ORM and Admin access to
Chancy's data. To install it, addchancy.contrib.django
to your
INSTALLED_APPS
. - The ProcessExecutor now has a django shim by default, simplifying setup.
v0.21.0
- Worker's page on the dashboard now shows worker tags and a badge if the
worker is the cluster's current leader. - The
workflow.upserted
event has been split intoworkflow.created
and
workflow.updated
events. Added a newworkflow.step_completed
event. WorkflowPlugin.push
now only pushes the workflow if it has actually changed.workflow.step_completed
is now used to nearly instantly progress a workflow
to the next step, instead of waiting for the next polling interval.- The
WorkflowPlugin
now exposes_ex
versions of most functions which touch
the database, allowing you to pass in your own cursor to ensure that a
workflow is created in the same transaction as other operations. - The
WorkflowPlugin
now locks the workflow row when updating it and performs
all updates in a single transaction. - All
_ex
functions which take a cursor now expect a cursor using a dict_row
row factory. - Improved metrics display by adding automatic formatting for large numbers
(K, M, G) on chart Y-axes. - Added
get_schedules()
helper method to the Cron plugin to retrieve
scheduled jobs. - Added a live stream of the internal events queue to the dashboard.
- Table size metrics are now collected for all tables known to plugins.