microsoft / garnet

Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
https://microsoft.github.io/garnet/
MIT License
10.26k stars 512 forks source link

expand lua support to include cmsgpack replacement #722

Open terinjokes opened 1 week ago

terinjokes commented 1 week ago

Feature request type

enhancement

Is your feature request related to a problem? Please describe

Some redis clients, such as the BullMQ library for Node.js, expect the server to have the cmsgpack library loaded into the Lua environment. The cmsgpack library is one of the external libraries documented as loaded in the redis API docs.

Describe the solution you'd like

The two documented functions cmsgpack.pack and cmsgpack.unpack should be added to the Lua environment, likely by using a C# implementation like MessagePack.

Describe alternatives you've considered

No response

Additional context

No response

badrishc commented 1 week ago

If this is needed, one could also use/update any usable OSS version of cmsgpack to work with NLua. Such as https://github.com/valkey-io/valkey/blob/unstable/deps/lua/src/lua_cmsgpack.c

Same observation holds for struct which is also used by a few scripts out there: https://github.com/valkey-io/valkey/blob/unstable/deps/lua/src/lua_struct.c

Note that NLua is simply a wrapper around KeraLua, which in turn basically packages the latest Lua binaries.