Git Product home page Git Product logo

Comments (5)

gfx avatar gfx commented on May 20, 2024

Looks nice. Patches welcome!

from msgpack-perl.

FGasper avatar FGasper commented on May 20, 2024

Iโ€™m working on a module to support WAMP, a messaging/RPC protocol. That protocol supports MessagePack, but itโ€™s a bit clumsy to implement because D::MP only uses its own boolean objects.

Can you point me in the appropriate direction for accessing and testing equality of a Perl global from XS? I may try to find time to work on this.

from msgpack-perl.

foobargeez avatar foobargeez commented on May 20, 2024

Ah, I am stuck with this one as well -- JSON->Perl data->MP -- fails.

Looks like a MR has already been submitted to address this -- #37.

Is there anything I can help with to have the fix merged into the module?

Thanks in advance!

from msgpack-perl.

foobargeez avatar foobargeez commented on May 20, 2024

Something in production broke because of this issue, so I had to come up with a workaround. Sharing it here so it helps others who may be looking for one:

  • If your input has blessed booleans, store them as \1 or \0. In my case, I am dealing with TOML files, so something like:
        my $parser = TOML::Parser->new(
            inflate_boolean => sub {
                my $boolean = shift;
                return $boolean eq 'true' ? \1 : \0;
            }
        );
  • Data::MessagePack stores the data as Data::MessagePack::Boolean blessed objects
  • Once you unpack the data, do an unbless (from Data::Structure::Util)

That should do the trick until the Data::MessagePack deals with Types::Serialiser::Boolean blessed objects.

from msgpack-perl.

FGasper avatar FGasper commented on May 20, 2024

@foobargeez Iโ€™m not sure why my PR is closed, but it expands compatibility to Types::Serialiser while maintaining compatibility with the proprietary flags.

This module appears to be abandoned, though. I tried to contact the maintainer several times and got no response.

from msgpack-perl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.