tastyware/streaq:v4.0.0 #40
Graeme22
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's Changed
New major release! Plenty of breaking changes, but most should be welcome.
Simple web UI added for monitoring tasks. Try it with
streaq test.worker --web! The UI is written with FastAPI, Bootstrap and HTMX and implemented in a way that allows easily mounting it onto a separate FastAPI app. (You'll need to install with thewebextra:pip install -U streaq[web])Task priorities have been completely rewritten. Previously, there was an enum of 3 hard-coded priorities,
TaskPriority, which has been replaced with aWorkerparameter,priorities, which allows for creating an arbitrary number of user-defined priorities and defaults to a single priority for those who don't need this functionality.Use of
pickle.loads, the default deserializer, is a security risk as an attacker who gains access to the Redis database would be able to run arbitrary code. You can now protect against this attack vector by passing asigning_secretto the worker. The signing key ensures corrupted data from Redis will not be unpickled.Reliability and pessimistic execution improved across the entire codebase. A new parameter,
Worker.idle_timeout, allows for detecting stale tasks that have been prefetched (and sometimes even begun execution). Tasks are more easily reclaimed when workers are shut down incorrectly and several edge cases have been eliminated. Prefetched tasks are now returned immediately to the queue on worker shutdown.New function added,
Worker.enqueue_many(), which allows for batching together enqueue calls into a single Redis pipeline for greater efficiency.Many Lua scripts have been made more efficient, and several scripts have been combined to further boost efficiency.
TaskDatahas been renamed toTaskInfoand now includes additional propertiesdependentsanddependencies.TaskResultnow includes additional propertiesfn_nameandenqueue_time, and no longer includesqueue_namewhich was redundant.Task.then()typing improvedWorker.queue_fetch_limitrenamed toWorker.prefetch. Prefetching can be disabled entirely by setting this to0.Many exceptions now contain additional stack trace info
Tests now use separate queue names for better isolation
Worker.with_schedulerhas been eliminated, aslisten_queueandlisten_streamhave been combined into a single, more efficient loop, meaning all workers can schedule tasks. Polling is now eliminated entirely from the library.Several internal worker functions have been combined into more efficient versions
Worker shutdown no longer kills tasks prematurely in some circumstances
Task abortion now works immediately for delayed tasks that are still enqueued
Full Changelog: v3.0.0...v4.0.0
This discussion was created from the release tastyware/streaq:v4.0.0.
Beta Was this translation helpful? Give feedback.
All reactions