rackdis 0.13.pre.beta → 0.14.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rackdis/api.rb +9 -7
- data/lib/rackdis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6def437fb8a8d6ca1ba958cf36ce14840ab72f
|
4
|
+
data.tar.gz: fc9df32e8e210c6797aa01cb03d31cdf9a01ea4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0112d42c1165b09053837ca82e9071157ce136832fa1540c07428723fed95644caf955dda6433e88a0c29137b7b749a15e9ebe8855dffbcef995d61039efc29f
|
7
|
+
data.tar.gz: 930c454e024fd2bbd20fc694631aefb591db57c1a3732d4fefb248608eb9b437f54ebcb2460e6ddb278ea11ba83d1fb16b5162a8d00639949297bb296f4d9916
|
data/lib/rackdis/api.rb
CHANGED
@@ -19,18 +19,20 @@ module Rackdis
|
|
19
19
|
|
20
20
|
def do_subscribe
|
21
21
|
after_open do
|
22
|
-
|
23
|
-
|
22
|
+
channels = params[:channels].split("/")
|
23
|
+
Rackdis.logger.debug "Someone subscribed to #{channels}"
|
24
|
+
redis.redis.subscribe(channels) do |on|
|
24
25
|
on.message do |channel, msg|
|
25
|
-
|
26
|
-
|
26
|
+
out = { channel: channel, message: msg }
|
27
|
+
Rackdis.logger.debug "Pushing: #{out}"
|
28
|
+
chunk out.to_json
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
status 200
|
32
34
|
header 'Content-Type', 'application/json'
|
33
|
-
""
|
35
|
+
return ""
|
34
36
|
end
|
35
37
|
|
36
38
|
def args
|
@@ -39,11 +41,11 @@ module Rackdis
|
|
39
41
|
end
|
40
42
|
|
41
43
|
# Subscribe
|
42
|
-
get 'subscribe
|
44
|
+
get 'subscribe/*channels' do
|
43
45
|
do_subscribe
|
44
46
|
end
|
45
47
|
|
46
|
-
get 'SUBSCRIBE
|
48
|
+
get 'SUBSCRIBE/*channels' do
|
47
49
|
do_subscribe
|
48
50
|
end
|
49
51
|
|
data/lib/rackdis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rackdis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert McLeod
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|