kriszyp / msgpackr

Ultra-fast MessagePack implementation with extension for record and structural cloning / msgpack.org[JavaScript/NodeJS]
MIT License
494 stars 55 forks source link

Allow for per-instance extensions #93

Open tsmaeder opened 1 year ago

tsmaeder commented 1 year ago

We use msgpackr in multiple places to encode/decode rpc calls. There are a couple of objects that need custom handling before encoding/decoding. We use Extensions to handle those type of objects. However the types of objects that need special handling is distinct per connection. It would be great if we could register Extensions per Packr/Unpackr instance, so that they apply only for a given connection, not everywhere. Feel free to tell me to RTFM if I'm just not understanding how I can do this.

kriszyp commented 1 year ago

This is a very reasonable request, but will need to put some thought into how best to implement.