Skip to content

raku-community-modules/Data-MessagePack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actions Status Actions Status Actions Status

NAME

Data::MessagePack - Raku 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.raku;
}, done => { say "Source supply is done"; } );

DESCRIPTION

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

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

Source can be located at: https://github.com/raku-community-modules/MessagePack . Comments and Pull Requests are welcome.

COPYRIGHT AND LICENSE

Copyright 2016 - 2018 Pierre Vigier

Copyright 2023, 2025 The Raku Community