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

Update serializer docs #7858

Merged
merged 2 commits into from
Oct 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions docs/userguide/calling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ them into the Kombu serializer registry
Each option has its advantages and disadvantages.

json -- JSON is supported in many programming languages, is now
a standard part of Python (since 2.6), and is fairly fast to decode
using the modern Python libraries, such as :pypi:`simplejson`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and is fairly fast to decode
using the modern Python libraries, such as :pypi:simplejson.
using modern Python libraries, such as :pypi:simplejson.

this part can be completely removed or rephrased as celery do not use simplejson anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7219ca3 👍

a standard part of Python (since 2.6), and is fairly fast to decode.

The primary disadvantage to JSON is that it limits you to the following
data types: strings, Unicode, floats, Boolean, dictionaries, and lists.
Expand Down Expand Up @@ -498,17 +497,29 @@ yaml -- YAML has many of the same characteristics as json,
If you need a more expressive set of data types and need to maintain
cross-language compatibility, then YAML may be a better fit than the above.

To use it, install Celery with:

.. code-block:: console

$ pip install celery[yaml]

See http://yaml.org/ for more information.

msgpack -- msgpack is a binary serialization format that's closer to JSON
in features. It's very young however, and support should be considered
experimental at this point.
in features. The format compresses better, so is a faster to parse and
encode compared to JSON.

To use it, install Celery with:

.. code-block:: console

$ pip install celery[msgpack]

See http://msgpack.org/ for more information.

The encoding used is available as a message header, so the worker knows how to
deserialize any task. If you use a custom serializer, this serializer must
be available for the worker.
To use a custom serializer you need add the content type to
:setting:`accept_content`. By default, only JSON is accepted,
and tasks containing other content headers are rejected.

The following order is used to decide the serializer
used when sending a task:
Expand Down