w3map 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/w3map +4 -0
- data/lib/w3map.rb +13 -0
- data/lib/w3map/version.rb +1 -1
- metadata +1 -1
data/bin/w3map
CHANGED
data/lib/w3map.rb
CHANGED
@@ -23,6 +23,7 @@ module W3map
|
|
23
23
|
raise InvalidSessionName if name.nil? || name.length == 0
|
24
24
|
@name = name
|
25
25
|
@redis_config = redis_config
|
26
|
+
register_session
|
26
27
|
end
|
27
28
|
def queue
|
28
29
|
@queue ||= DistributedQueue.new(@name, @redis_config)
|
@@ -30,6 +31,18 @@ module W3map
|
|
30
31
|
def dstore
|
31
32
|
@dstore ||= DataStore.new(@name, @redis_config)
|
32
33
|
end
|
34
|
+
def sessions
|
35
|
+
@redis = Redis.new
|
36
|
+
sessions = @redis.smembers "#{REDIS_PREFIX}:sessions"
|
37
|
+
@redis.quit
|
38
|
+
sessions.sort
|
39
|
+
end
|
40
|
+
private
|
41
|
+
def register_session
|
42
|
+
@redis = Redis.new
|
43
|
+
@redis.sadd "#{REDIS_PREFIX}:sessions", @name
|
44
|
+
@redis.quit
|
45
|
+
end
|
33
46
|
end
|
34
47
|
|
35
48
|
class DataStore
|
data/lib/w3map/version.rb
CHANGED