Class: Conflow::Redis::Script Private
- Inherits:
-
Object
- Object
- Conflow::Redis::Script
- Defined in:
- lib/conflow/redis/script.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Main class for scripts, handling logic of executing and caching scripts.
Direct Known Subclasses
AddJobScript, CompleteJobScript, QueueJobsScript, ResolvePromisesScript
Class Attribute Summary collapse
-
.cache_scripts ⇒ Object
This options decides whether scripts used by the gem will be cached in Redis or not.
-
.script ⇒ String
readonly
private
LUA script of this Conflow::Redis::Script.
Class Method Summary collapse
-
.call(keys, args = []) ⇒ Object
private
Executes script in Redis with given arguments.
-
.inherited(base) ⇒ Object
private
Sets cache_scripts option on inherited scripts.
Class Attribute Details
.cache_scripts ⇒ Object
This options decides whether scripts used by the gem will be cached in Redis or not. See Redis EVAL and Redis EVALSHA.
10 11 12 |
# File 'lib/conflow/redis/script.rb', line 10 def cache_scripts @cache_scripts end |
.script ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns LUA script of this Conflow::Redis::Script.
12 13 14 |
# File 'lib/conflow/redis/script.rb', line 12 def script @script end |
Class Method Details
.call(keys, args = []) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Executes script in Redis with given arguments.
38 39 40 |
# File 'lib/conflow/redis/script.rb', line 38 def call(*args) Conflow.redis.with { |conn| send(command, conn, args) } end |
.inherited(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets cache_scripts option on inherited scripts
15 16 17 18 19 |
# File 'lib/conflow/redis/script.rb', line 15 def inherited(base) scripts << base base.cache_scripts = cache_scripts super end |