A Lua script called with P: params(*args) gives its keys
then its arguments, number_of_keys(*args) how many of them are
keys, and decode reads its reply. Scripts are cached by identity,
so make each one once.
Attributes#
| Attribute | Type | Description |
|---|---|---|
lua | str | |
params | Callable[P, Sequence[str | float]] | |
number_of_keys | Callable[P, int] | |
decode | Callable[[RedisReply], A_co] |
Functions#
__init__#
__init__(lua, params, number_of_keys, decode) -> None| Parameter | Type | Description |
|---|---|---|
lua | str | |
params | Callable[P, Sequence[str | float]] | |
number_of_keys | Callable[P, int] | |
decode | Callable[[RedisReply], A_co] |
arguments#
arguments(*args, **kwargs) -> list[str]EVALSHA's arguments after the hash: the key count, the keys
and the arguments, numbers written as JavaScript's String.
| Parameter | Type | Description |
|---|---|---|
args | P.args = () | |
kwargs | P.kwargs = {} |
Returns list[str]
def arguments(self, *args: P.args, **kwargs: P.kwargs) -> list[str]:
"""``EVALSHA``'s arguments after the hash: the key count, the keys
and the arguments, numbers written as JavaScript's ``String``."""
params = [_argument(param) for param in self.params(*args, **kwargs)]
return [str(self.number_of_keys(*args, **kwargs)), *params]