Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

charliewolf
Copy link
Contributor

No description provided.

@charliewolf
Copy link
Contributor Author

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):
Copy link
Member

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': [],

Copy link
Member

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
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants