Skip to content
Message pack implementation for perl6 / msgpack.org[Perl 6]
Other Shell
  1. Other 99.4%
  2. Shell 0.6%
Branch: master
Clone or download

Latest commit

pierre-vigier Hash key order randomization test issue
Non preservation of hash key was breaking a test, use a Unpack
then Pack combination isntead of testing the generated Byte list
for hashes
Latest commit 99766f3 May 21, 2018

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/Data
t
.gitignore
.travis.yml
LICENSE
META6.json
README.md
update_readme.sh

README.md

Perl6-Data-MessagePack

Build Status

NAME

Data::MessagePack - Perl 6 implementation of MessagePack

SYNOPSIS

use Data::MessagePack;

my $data-structure = {
    key => 'value',
    k2 => [ 1, 2, 3 ]
};

my $packed = Data::MessagePack::pack( $data-structure );

my $unpacked = Data::MessagePack::unpack( $packed );

Or for streaming:

use Data::MessagePack::StreamingUnpacker;

my $supplier = Some Supplier; #Could be from IO::Socket::Async for instance

my $unpacker = Data::MessagePack::StreamingUnpacker.new(
    source => $supplier.Supply
);

$unpacker.tap( -> $value {
    say "Got new value";
    say $value.perl;
}, done => { say "Source supply is done"; } );

DESCRIPTION

The present module proposes an implemetation of the MessagePack specification as described on http://msgpack.org/. The implementation is now in Pure Perl which could come as a performance penalty opposed to some other packer implemented in C.

WHY THAT MODULE

There are already some part of MessagePack implemented in Perl6, with for instance MessagePack available here: https://github.com/uasi/messagepack-pm6, however that module only implements the unpacking part of the specification. Futhermore, that module uses the unpack functionality which is tagged as experimental as of today

FUNCTIONS

function pack

That function takes a data structure as parameter, and returns a Blob with the packed version of the data structure.

function unpack

That function takes a MessagePack packed message as parameter, and returns the deserialized data structure.

Author

Pierre VIGIER

Contributors

Timo Paulssen

License

Artistic License 2.0

You can’t perform that action at this time.