coursedaa.blogg.se

Muorigin lua script
Muorigin lua script








It is just a Lua program that will run in the Redis engine's context. The script doesn't need to include any definitions of Lua function. The first argument is a string that consists of the script's Lua source code. In this example, EVAL takes two arguments. Here's our first example: > EVAL "return 'Hello, scripting!'" 0 We'll start scripting with Redis by using the EVAL command.

muorigin lua script

So all scripts may need to be reloaded by the application at any time if missing (after a server restart, fail-over to a replica, etc.).Īs of version 7.0, Redis Functions offer an alternative approach to programmability which allow the server itself to be extended with additional programmed logic. Please refer to the Redis Lua API Reference page for complete documentation.Īlthough the server executes them, Eval scripts are regarded as a part of the client-side application, which is why they're not named, versioned, or persisted. Presently, Redis supports a single scripting engine, the Lua 5.1 interpreter. Scripts are executed in Redis by an embedded execution engine. Such scripts can perform conditional updates across multiple keys, possibly combining several different data types atomically. Lua lets you run part of your application logic inside Redis.

muorigin lua script

  • Enabling the composition of simple capabilities that are either missing from Redis or are too niche to a part of it.
  • Blocking semantics that ensure the script's atomic execution.
  • Data locality reduces overall latency and saves networking resources.
  • Providing locality by executing logic where data lives.
  • Scripting offers several properties that can be valuable in many cases. These semantics mean that all of the script's effects either have yet to happen or had already happened. While executing the script, all server activities are blocked during its entire runtime. Redis guarantees the script's atomic execution.

    muorigin lua script

    Scripts can employ programmatic control structures and use most of the commands while executing to access the database.īecause scripts execute in the server, reading and writing data from scripts is very efficient. Redis lets users upload and execute Lua scripts on the server.










    Muorigin lua script