Improve compliance with django.tasks spec#2
Open
RealOrangeOne wants to merge 5 commits intolincolnloop:mainfrom
Open
Improve compliance with django.tasks spec#2RealOrangeOne wants to merge 5 commits intolincolnloop:mainfrom
django.tasks spec#2RealOrangeOne wants to merge 5 commits intolincolnloop:mainfrom
Conversation
Since the signals also handling logging, the custom logging can be removed
`get_result` support requires that results can be obtained from any thread or process.
The JSON requirement is already handled by TaskResult. Items which are JSON serializable are all picklable.
fgregg
added a commit
to fgregg/django-tasks-local-db
that referenced
this pull request
Mar 3, 2026
Adapt compliance improvements from lincolnloop/django-tasks-local#2: - Send task_enqueued, task_started, task_finished signals - Support takes_context tasks via TaskContext and task.call() - Set worker ID via db_result.claim() in _execute_task - Remove current_result_id ContextVar, pickle validation, and logger.exception - Normalize return value in _execute_task instead of _on_complete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a few more features missing from
django-tasks-localneeded to be a compliant backend:supports_get_results, since they can't be obtained from other processestakes_context, which avoids the need for thecurrent_result_idcontext varThese simplify the implementation a fair bit, and support all the features of
django.tasks.(There's no formal spec, just docs)