Serverside Redis Commands

With the RedGrease runtime package installed on the RedGrease server, you can execute Redis commands to the local shards using “serverside commands” instead of using redgrease.runtime.execute() inside your Gear functions.

Serverside Redis Commands, behaves almost identical to a normal Redis client, except that you do not have to instantiate it.

Inside any Gear function, you can simply invoke Redis commands just as you would in your client using redgrease.cmd:

Example:

redgrease.cmd.set("Foo", "Bar")

Warning

Serverside Redis Commands have the following limitations:

  1. Only executes commands against the local shard.

    This is also the case for both the redgrease.runtime.execute() function as well as the the RedisGears default builtin execute() function too.

  2. Blocking commands, such as “BRPOP” or “BLPOP” ect, are not supported.

    This is also the case for both the redgrease.runtime.execute() function as well as the the RedisGears default builtin execute() function too.


Courtesy of : Lyngon Pte. Ltd.