Class: Redis::ScriptManager::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/script_manager.rb

Instance Method Summary collapse

Instance Method Details

#do_minify_luaObject

Defaults to false.

If true, all Lua is minified conservatively to save bandwidth before any other logic or evaluation.



281
282
283
# File 'lib/redis/script_manager.rb', line 281

def do_minify_lua
  @do_minify_lua || false
end

#do_minify_lua=(do_minify_lua) ⇒ Object



284
285
286
# File 'lib/redis/script_manager.rb', line 284

def do_minify_lua=(do_minify_lua)
  @do_minify_lua = [true,'true'].include?(do_minify_lua)
end

#do_preloadObject

Defaults to false.

If true, shas are preloaded for each Redis connection (which make safe to use EVALSHA even in pipelines).



307
308
309
# File 'lib/redis/script_manager.rb', line 307

def do_preload
  @do_preload || false
end

#do_preload=(do_preload) ⇒ Object



310
311
312
# File 'lib/redis/script_manager.rb', line 310

def do_preload=(do_preload)
  @do_preload = [true,'true'].include?(do_preload)
end

#max_tiny_luaObject

Scripts shorter than max_tiny_lua are always EVALed.

We skip all logic regarding EVALSHA, extra round-trips for SCRIPT LOAD, etc.

Defaults to 512. Integers and Strings which convert to Integers OK.



295
296
297
# File 'lib/redis/script_manager.rb', line 295

def max_tiny_lua
  @max_tiny_lua || 512
end

#max_tiny_lua=(max_tiny_lua) ⇒ Object



298
299
300
# File 'lib/redis/script_manager.rb', line 298

def max_tiny_lua=(max_tiny_lua)
  @max_tiny_lua = max_tiny_lua.to_i
end

#preload_cache_sizeObject

The cache of shas which have been preloaded is not allowed to grow larger than this value.

Defaults to 1000.



319
320
321
# File 'lib/redis/script_manager.rb', line 319

def preload_cache_size
  @preload_cache_size || 1000
end

#preload_cache_size=(preload_cache_size) ⇒ Object



322
323
324
# File 'lib/redis/script_manager.rb', line 322

def preload_cache_size=(preload_cache_size)
  @preload_cache_size = preload_cache_size.to_i
end

#stats_prefixObject

Defaults to ”.

Prefixed onto all metrics.



266
267
268
# File 'lib/redis/script_manager.rb', line 266

def stats_prefix
  @stats_prefix || ''
end

#stats_prefix=(stats_prefix) ⇒ Object



269
270
271
272
273
274
# File 'lib/redis/script_manager.rb', line 269

def stats_prefix=(stats_prefix)
  if stats_prefix && !stats_prefix.is_a?(String)
    raise ArgumentError, "bogus stats_prefix"
  end
  @stats_prefix = stats_prefix || ''
end

#statsdObject

Defaults to nil. If non-nil, lots of stats will be tracked via statsd.increment and statsd.timing.



249
250
251
# File 'lib/redis/script_manager.rb', line 249

def statsd
  @statsd || nil
end

#statsd=(statsd) ⇒ Object



252
253
254
255
256
257
258
259
260
# File 'lib/redis/script_manager.rb', line 252

def statsd=(statsd)
  if statsd && !statsd.respond_to?(:increment)
    raise ArgumentError, "bogus statsd A #{statsd}"
  end
  if statsd && !statsd.respond_to?(:timing)
    raise ArgumentError, "bogus statsd B #{statsd}"
  end
  @statsd = statsd
end