You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,7 @@ to 10, and all ``websocket.send!`` channels to 20:
171
171
If you want to enforce a matching order, use an ``OrderedDict`` as the
172
172
argument; channels will then be matched in the order the dict provides them.
173
173
174
+
.. _encryption
174
175
``symmetric_encryption_keys``
175
176
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176
177
@@ -237,6 +238,51 @@ And then in your channels consumer, you can implement the handler:
237
238
asyncdefredis_disconnect(self, *args):
238
239
# Handle disconnect
239
240
241
+
242
+
243
+
``serializer_format``
244
+
~~~~~~~~~~~~~~~~~~~~~~
245
+
By default every message sent to redis is encoded using `msgpack <https://msgpack.org/>`_ (_currently ``msgpack`` is a mandatory dependency of this package, it may become optional in a future release_).
246
+
It is also possible to switch to `JSON <http://www.json.org/>`_:
**NOTE**: the registry allows to override the serializer class used for a specific format without any particular check nor constraint, thus it is recommended to pay attention with order-of-imports when using third-party serializers which may override a built-in format.
281
+
282
+
283
+
Serializers are also responsible for encryption *symmetric_encryption_keys*. When extending ``channels_redis.serializers.BaseMessageSerializer`` encryption is already configured in the base class, unless you override ``serialize``/``deserialize`` methods: in this case you should call ``self.crypter.encrypt`` in serialization and ``self.crypter.decrypt`` in deserialization process. When using full custom serializer expect an optional sequence of keys to be passed via ``symmetric_encryption_keys``.
0 commit comments