FCALL

Since 1.1.0ScriptingKnown issue

Syntax

FCALL function_name numkeys key [key ...] arg [arg ...]
  • Flags: movablekeys, readonly
  • ACL categories: @scripting, @slow
  • Arity: -3

Calls a function of a library loaded with FUNCTION LOAD. numkeys is how many of the arguments that follow are key names, passed to the function as its first argument; the rest are its second.

A function is held to the flags it was registered with. With no-writes, it cannot write. When the server is at its memory limit, a function runs only if it has allow-oom or no-writes.

Known issue

Refused on a replica with READONLY, even for a function that only reads; use FCALL_RO there. Filed as kividb#145, fixed in 1.2.

In a cluster, a redis.call on a key in a slot another node owns is not refused: the key is written on this node, where clients will not find it. Filed as kividb#153, fixed in 1.2.

Reply

  • What the function returns, converted as for EVAL.
  • ERR Function not found.

Examples

> FCALL hello 0 Ada
"hi Ada"