Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add a way to run lua commands before lua scripts in defineCommand/eval run? #1195

Open
TysonAndre opened this issue Jul 15, 2022 · 0 comments

Comments

@TysonAndre
Copy link
Contributor

E.g. this would allow mocking the subset of functionality that was used in an application for #1143 or the currently missing cjson or other applications that aren't supported

This would involve something similar to defineRedisObject in src/commands/defineCommand.js

  • where luaInit would get called after defineRedisObject is called but before the lua user code runs.
const redis = new RedisMock({
    luaInit: (vm) => {
        // vm.defineGlobalFunction/luaExecString/lua_setglobal calls
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants