tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

api: custom packer and unpacker factories #268

Closed DifferentialOrange closed 1 year ago

DifferentialOrange commented 1 year ago

After this patch, user may pass packer_factory and unpacker_factory options to a connection. They will be used instead of the default ones. packer_factory is expected to be a function with the only one parameter: connection object, which returns a new msgpack.Packer object. unpacker_factory is expected to be a function with the only one parameter: connection object, which returns a new msgpack.Unpacker object. packer_factory supersedes encoding option. unpacker_factory supersedes encoding and use_list options. User may implement encoding and use_list support in its custom packer or unpacker if they wish so. User may refer to request submodule packer_factory and response submodule unpacker_factory as an example (these factories are used by default.)

Closes #154, #190, #191