Add some API documentation for Cython-based deserializers

This commit is contained in:
Mark Florisson
2015-08-11 21:30:32 +01:00
parent 9240c71c02
commit 02be9f441a
2 changed files with 15 additions and 1 deletions

View File

@@ -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

View File

@@ -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