diff --git a/cassandra/protocol.py b/cassandra/protocol.py index 3cb13351..25311911 100644 --- a/cassandra/protocol.py +++ b/cassandra/protocol.py @@ -894,7 +894,7 @@ class ProtocolHandler(object): result decoding implementations. """ - @classmethod + @classmethod def encode_message(cls, msg, stream_id, protocol_version, compressor): """ Encodes a message using the specified frame parameters, and compressor diff --git a/docs/api/cassandra/protocol.rst b/docs/api/cassandra/protocol.rst index cabf2b59..0d4df101 100644 --- a/docs/api/cassandra/protocol.rst +++ b/docs/api/cassandra/protocol.rst @@ -24,3 +24,17 @@ See :meth:`.Session.execute`, ::meth:`.Session.execute_async`, :attr:`.ResponseF .. automethod:: encode_message .. automethod:: decode_message + +Faster Deserialization +---------------------- +When python-driver is compiled with Cython, it uses a Cython-based deserialization path +to deserialize messages. There are two additional ProtocolHandler classes that can be +used to deserialize response messages: the first is ``LazyProtocolHandler`` and the +second is ``NumpyProtocolHandler``.They can be used as follows: + +.. code:: python + + from cassandra.protocol import NumpyProtocolHandler, LazyProtocolHandler + s.client_protocol_handler = LazyProtocolHandler # for a result iterator + s.client_protocol_handler = NumpyProtocolHandler # for a dict of NumPy arrays as result +