Module: Redistat

Defined in:
lib/redistat.rb,
lib/redistat/key.rb,
lib/redistat/date.rb,
lib/redistat/event.rb,
lib/redistat/label.rb,
lib/redistat/model.rb,
lib/redistat/scope.rb,
lib/redistat/buffer.rb,
lib/redistat/finder.rb,
lib/redistat/result.rb,
lib/redistat/summary.rb,
lib/redistat/version.rb,
lib/redistat/collection.rb,
lib/redistat/connection.rb,
lib/redistat/mixins/options.rb,
lib/redistat/finder/date_set.rb,
lib/redistat/mixins/database.rb,
lib/redistat/mixins/date_helper.rb,
lib/redistat/mixins/synchronize.rb

Defined Under Namespace

Modules: Connection, Database, DateHelper, Model, Options, Synchronize Classes: Buffer, Collection, Date, Event, Finder, InvalidOptions, Key, Label, RedisServerIsTooOld, Result, Scope, Summary

Constant Summary collapse

KEY_NEXT_ID =
".next_id"
KEY_EVENT =
".event:"
KEY_LABELS =

used for reverse label hash lookup

"Redistat.labels:"
KEY_EVENT_IDS =
".event_ids"
LABEL_INDEX =
".label_index:"
GROUP_SEPARATOR =
"/"
VERSION =
"0.5.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.group_separatorObject



94
95
96
# File 'lib/redistat.rb', line 94

def group_separator
  @group_separator ||= GROUP_SEPARATOR
end

Class Method Details

.bufferObject



55
56
57
# File 'lib/redistat.rb', line 55

def buffer
  Buffer.instance
end

.buffer_sizeObject



59
60
61
# File 'lib/redistat.rb', line 59

def buffer_size
  buffer.size
end

.buffer_size=(size) ⇒ Object



63
64
65
# File 'lib/redistat.rb', line 63

def buffer_size=(size)
  buffer.size = size
end

.connect(options) ⇒ Object



85
86
87
# File 'lib/redistat.rb', line 85

def connect(options)
  Connection.create(options)
end

.connection(ref = nil) ⇒ Object Also known as: redis



75
76
77
# File 'lib/redistat.rb', line 75

def connection(ref = nil)
  Connection.get(ref)
end

.connection=(connection) ⇒ Object Also known as: redis=



80
81
82
# File 'lib/redistat.rb', line 80

def connection=(connection)
  Connection.add(connection)
end

.flushObject



89
90
91
92
# File 'lib/redistat.rb', line 89

def flush
  puts "WARNING: Redistat.flush is deprecated. Use Redistat.redis.flushdb instead."
  connection.flushdb
end

.thread_safeObject



67
68
69
# File 'lib/redistat.rb', line 67

def thread_safe
  Synchronize.thread_safe
end

.thread_safe=(value) ⇒ Object



71
72
73
# File 'lib/redistat.rb', line 71

def thread_safe=(value)
  Synchronize.thread_safe = value
end