tastyware/streaq:v6.0.0b2 #126
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
Ability to set custom formatters for task results and exceptions in Web UI by @espdev in Ability to set custom formatters for task results and exceptions in Web UI #95
get_result_formatterandget_exception_formatterto customize result/exception outputBump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in Bump astral-sh/setup-uv from 6 to 7 #96
Update docs for SAQ comparison: abort support by @vikigenius in Update docs for SAQ comparison: abort support #100
Custom worker id feature by @espdev in Custom worker id feature #101
The PR adds ability to set a custom worker id.
Place sleep after the first healthcheck, not before it. by @espdev in Place sleep after the first healthcheck, not before it. #104
Add the info about exception traceback serialization with tblib to the docs by @espdev in Add the info about exception traceback serialization with tblib to the docs #105
Improve the user experience when running tests by @espdev in Improve the user experience when running tests #107
Bump actions/checkout from 5 to 6 by @dependabot[bot] in Bump actions/checkout from 5 to 6 #110
dynamic cron jobs by @Graeme22 in dynamic cron jobs #117
Moves cron registry to Redis. This allows for dynamically adding/removing cron jobs.
RegisteredCronis collapsed intoRegisteredTask.Bump python-multipart from 0.0.20 to 0.0.22 by @dependabot[bot] in Bump python-multipart from 0.0.20 to 0.0.22 #120
Bump urllib3 from 2.5.0 to 2.6.3 by @dependabot[bot] in Bump urllib3 from 2.5.0 to 2.6.3 #121
Bump starlette from 0.48.0 to 0.49.1 by @dependabot[bot] in Bump starlette from 0.48.0 to 0.49.1 #122
Bump filelock from 3.19.1 to 3.20.3 by @dependabot[bot] in Bump filelock from 3.19.1 to 3.20.3 #123
Modular changes by @Graeme22 in Modular changes #125
Instead of each worker maintaining a list of "coworkers" whose context managers would also have to be entered (which led to a ton of duplicate Redis clients and some messy code with
AsyncExitStack),Worker.include()simply modifies the included worker's tasks to point to it instead. At its face this sounds like it could lead to problems, but since a) Only one worker is running per process at a time; and b) Workers that are included in other workers are not aware of that at import time, practically this is a clean and easy solution. To make this a bit more concrete:Here, we can actually run either worker independently without issues:
streaq run child_module:childandstreaq run parent_module:parentshould both work fine, because when running just the child, theparent.include(child)line will never run.The other element of this PR that is quite crucial is detaching the ability to access task and worker context from the worker instance itself. Under the hood this is done with a couple global
ContextVars, but in practice it uses a clean, FastAPI-like dependency injection pattern:What this enables that was not previously possible is a total separation of concerns. Task definitions can now access dependencies without having to know anything about the top level
Workerthey will eventually be included in. This replaces the previousWorker.contextandWorker.task_context()functions altogether. Since coredis 6.0.0 is around the corner, this will likely be the last breaking change for the foreseeable future.Finally, this PR adds a few other things in preparation for the v6.0.0 release:
streaqcommand has been split into two subcommands,streaq runandstreaq webfor running a worker and the web UI respectively. As a bonus this allowed for getting some extra coverage that was previously marked with# pragma: no cover.Task.then()andTask.__or__(), which some fancy overloads and aTypeVarTuplethat allow for nearly perfect typing of the complex scenario where results from one task are fed into the next.StreaqRetry,StreaqError, andStreaqCancelledhave been moved from utils to thestreaq.typesmodule.Workercan now be initialized from acoredis.ConnectionPoolinstead of a connection URI.New Contributors
Full Changelog: v6.0.0...v6.0.0b2
This discussion was created from the release tastyware/streaq:v6.0.0b2.
Beta Was this translation helpful? Give feedback.
All reactions