Skip to content

api: custom packer and unpacker factories - #268

Merged
DifferentialOrange merged 1 commit into
masterfrom
DifferentialOrange/gh-191-custom-packer-unpacker
Dec 1, 2022
Merged

DifferentialOrange merged 1 commit into
masterfrom
DifferentialOrange/gh-191-custom-packer-unpacker

Conversation

@DifferentialOrange

@DifferentialOrange DifferentialOrange commented Nov 30, 2022 •

Copy link
Copy Markdown
Member

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

@DifferentialOrange
DifferentialOrange force-pushed the DifferentialOrange/gh-191-custom-packer-unpacker branch 3 times, most recently from d158728 to f59e532 Compare December 1, 2022 07:54
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 #145, #190, #191
@DifferentialOrange
DifferentialOrange force-pushed the DifferentialOrange/gh-191-custom-packer-unpacker branch from f59e532 to 51db95b Compare December 1, 2022 08:09
@DifferentialOrange
DifferentialOrange marked this pull request as ready for review December 1, 2022 08:18

@GRISHNOV GRISHNOV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi! LGTM

@DifferentialOrange
DifferentialOrange merged commit 1154b3d into master Dec 1, 2022
@DifferentialOrange
DifferentialOrange deleted the DifferentialOrange/gh-191-custom-packer-unpacker branch December 1, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants