Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shogo82148/p5-redis-script
https://github.com/shogo82148/p5-redis-script
perl perl5 redis
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shogo82148/p5-redis-script
- Owner: shogo82148
- License: other
- Created: 2016-02-09T11:14:08.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T06:11:59.000Z (over 1 year ago)
- Last Synced: 2024-10-14T20:52:29.873Z (2 months ago)
- Topics: perl, perl5, redis
- Language: Perl
- Size: 40 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Actions Status](https://github.com/shogo82148/p5-Redis-Script/actions/workflows/test.yml/badge.svg)](https://github.com/shogo82148/p5-Redis-Script/actions) [![MetaCPAN Release](https://badge.fury.io/pl/Redis-Script.svg)](https://metacpan.org/release/Redis-Script)
# NAMERedis::Script - wrapper class for Redis' script
# SYNOPSIS
# OO-interface
use Redis;
use Redis::Script;
my $script = Redis::Script->new(script => "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}");
my ($key1, $key2, $arg1, $arg2) = $script->eval(Redis->new, ['key1', 'key2'], ['arg1', 'arg2']);
# Functional
use Redis::Script qw/redis_eval/;
my ($key1, $key2, $arg1, $arg2) = redis_eval(Redis->new, "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", ['key1', 'key2'], ['arg1', 'arg2']);# DESCRIPTION
Redis::Script is wrapper class for Redis' script.
# FUNCTIONS
## `$script->eval($redis:Redis, $keys:ArrayRef, $args:ArrayRef)`
`eval` executes the script by `EVALSHA` command.
If `EVALSHA` reports "No matching script", use `EVAL` instead of `EVALSHA`.
Redis will cache the script of `EVAL` command, so `EVALSHA` will succeed next time.If `use_evalsha` option is false, `eval` does not use `EVALSHA` command.
## `$script->exists($redis:Redis)`
`exists` reports if `$redis` caches the script.
## `$script->load($redis:Redis)`
Load a script into the scripts cache, without executing it.
# SEE ALSO
- [Redis.pm](https://metacpan.org/pod/Redis)
- [Redis::Fast](https://metacpan.org/pod/Redis::Fast)
- [Description of EVAL](http://redis.io/commands/eval#bandwidth-and-evalsha)# LICENSE
Copyright (C) ICHINOSE Shogo.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
ICHINOSE Shogo