Skip to content

[FEA] A fallback mechanism #26

Description

@madsbk

Feature request, make it possible to specify a fallback function that is called when the encoder encounters an unsupported object.
The fallback function can then handle the unsupported object using only msgspec compatible types. When decoding, a corresponding fallback function are then called to handle the decoding of the object.

Motivation

In Dask/Distributed we are discussing the replacement of msgpack. The library should be:

  • fast
  • secure (no arbitrary code execution when decoding)
  • support basic Python types
  • not convert list to tuples (can be disabled in msgpack but with a performance penalty)
  • not convert numpy scalars to python scalars
  • support a fallback mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions