Stackexchange.redis Lua Script Compex C Object

Use Git or checkout with SVN using the web URL. Work fast with our official CLI. If nothing happens, download GitHub Desktop and try again. If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual. The console will look for files where Cyberpunk2077.exe is located, ideally you will put your files in a folder dedicated to that, for example official Cyber Engine Tweaks files are located in plugins/cyberenginetweaks/scripts, here we will assume you put your custom.lua file in this scripts folder. Using scripts with C is great. They provide lots of flexibility and free you from using those.txt files for your configuration files and also let you write complex functions. EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0. The first argument of EVAL is a Lua 5.1 script. The script does not need to define a Lua function (and should not). It is just a Lua program that will run in the context of the Redis server. Lua is intended for script-only objects at this point (with embryo left for augmenting standard programs). Since script-only objects effectively define objects entirely via Lua script (resize handling, event handling etc. Etc.) this places many more demands on them, and thus a more powerful language is in order.

Basic Lua scripting is supported by the IServer.ScriptLoad(Async), IServer.ScriptExists(Async), IServer.ScriptFlush(Async), IDatabase.ScriptEvaluate, and IDatabaseAsync.ScriptEvaluateAsync methods.These methods expose the basic commands necessary to submit and execute Lua scripts to redis.

More sophisticated scripting is available through the LuaScript class. The LuaScript class makes it simpler to prepare and submit parameters along with a script, as well as allowing you to use cleaner variables names.

Stackexchange.redis Lua Script Compex C ObjectStackexchange.redis lua script compex c objects

An example use of the LuaScript:

The LuaScript class rewrites variables in scripts of the form @myVar into the appropriate ARGV[someIndex] required by redis. If the parameter passed is of type RedisKey it will be sent as part of the KEYS collection automatically.

Redis Load Lua Script

Any object that exposes field or property members with the same name as @-prefixed variables in the Lua script can be used as a parameter hash toEvaluate calls. Supported member types are the following:

  • int(?)
  • long(?)
  • double(?)
  • string
  • byte[]
  • bool(?)
  • RedisKey
  • RedisValue

Stackexchange.redis Lua Script Compex C Objects

To avoid retransmitting the Lua script to redis each time it is evaluated, LuaScript objects can be converted into LoadedLuaScripts via LuaScript.Load(IServer).LoadedLuaScripts are evaluated with the EVALSHA, and referred to by hash.

Stackexchange.redis Lua Script Compex C Objective

An example use of LoadedLuaScript:

All methods on both LuaScript and LoadedLuaScript have Async alternatives, and expose the actual script submitted to redis as the ExecutableScript property.

This site is open source. Improve this page.