Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options undocumented #27

Open
Bilge opened this issue Feb 2, 2021 · 1 comment
Open

Options undocumented #27

Bilge opened this issue Feb 2, 2021 · 1 comment

Comments

@Bilge
Copy link

Bilge commented Feb 2, 2021

It seems there are options for both serialize() and unserialize(), but I do not know what they do. I have read the following comment but I don't know what it means.

Indicates whether multiple values in data are concatenated to multiple MessagePack arrays.

Perhaps an example would help?

@ygoe
Copy link
Owner

ygoe commented Nov 17, 2022

Not sure why that exists, maybe somebody else wrote it. As I understand the code:

If you serialise an array, you get a MessagePack stream that represents an array that contains the values that the original array contains. You get what you give.

With the "multiple" option, when you serialise an array, you instead get multiple concatenated independent MessagePack streams each representing an item of the original array. The MessagePack data will not contain the original array anymore.

Probably a convenience thing for some use case. You could also do this manually, serialising each array item and then concatenating all the results.

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

No branches or pull requests

2 participants