-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom serializers #22
base: master
Are you sure you want to change the base?
Conversation
3936793
to
5debfca
Compare
Addresses #21 |
@@ -12,7 +11,7 @@ class Task(object): | |||
def __init__(self, tiger, func=None, args=None, kwargs=None, queue=None, | |||
hard_timeout=None, unique=None, lock=None, lock_key=None, | |||
retry=None, retry_on=None, retry_method=None, | |||
_data=None, _state=None, _ts=None, _executions=None): | |||
_data=None, _state=None, _ts=None, _executions=None, deserialize=json.loads, serialize=json.dumps): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove these.
@@ -132,10 +132,17 @@ def __init__(self, connection=None, config=None, setup_structlog=False): | |||
|
|||
# If non-empty, a worker only processeses the given queues. | |||
'ONLY_QUEUES': [], | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have a quick comment just like the other settings.
@@ -1,3 +1,4 @@ | |||
import pickle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I preferably don't want to mention pickle
in this package since it suggests that this would be a sane choice. A better example would be JSON with a custom JSONEncoder
/JSONDecoder
. This would then also ensure that the given serialization is actually being used (since the default encoder would throw an error).
No description provided.