celluloid_pubsub 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/celluloid_pubsub/reactor.rb +15 -14
- data/lib/celluloid_pubsub/redis/redis_reactor.rb +0 -1
- data/lib/celluloid_pubsub/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acb771f697e6cac9c0791af4441d1e5ed06deb19
|
4
|
+
data.tar.gz: eeedcfac88bfbdda3531fe7dbcaee2ee17e24ba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184d0cb67d194b6638ac08dc9aad2db03fe2a388d41c1318593685a1e2ccab3d9cdedd20587c0284468cba516887fc906dd58bc20b889b2b879080461c157dec
|
7
|
+
data.tar.gz: 186ad47afeb3b078a0d98c04d1027100e47e438a0485226d88f91bd9db1902dbc264a05a14e906abba60d858eda5663e1de87d23b0c60ca4d6d88a1ca4476d51
|
@@ -157,18 +157,18 @@ module CelluloidPubsub
|
|
157
157
|
def delegate_action(json_data)
|
158
158
|
channel = json_data.fetch('channel', nil)
|
159
159
|
case json_data['client_action']
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
160
|
+
when 'unsubscribe_all'
|
161
|
+
unsubscribe_all
|
162
|
+
when 'unsubscribe_clients'
|
163
|
+
async.unsubscribe_clients(channel)
|
164
|
+
when 'unsubscribe'
|
165
|
+
async.unsubscribe(channel)
|
166
|
+
when 'subscribe'
|
167
|
+
async.start_subscriber(channel, json_data)
|
168
|
+
when 'publish'
|
169
|
+
@server.publish_event(channel, json_data['data'].to_json)
|
170
|
+
else
|
171
|
+
handle_unknown_action(json_data)
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
@@ -192,6 +192,7 @@ module CelluloidPubsub
|
|
192
192
|
@channels.delete(channel)
|
193
193
|
end
|
194
194
|
end
|
195
|
+
|
195
196
|
# the method will unsubscribe a client by closing the websocket connection if has unscribed from all channels
|
196
197
|
# and deleting the reactor from the channel list on the server
|
197
198
|
#
|
@@ -254,8 +255,8 @@ module CelluloidPubsub
|
|
254
255
|
end
|
255
256
|
|
256
257
|
def channel_subscribers(channel)
|
257
|
-
|
258
|
-
|
258
|
+
@server.subscribers[channel] || []
|
259
|
+
end
|
259
260
|
|
260
261
|
# adds the curent actor the list of the subscribers for a particular channel
|
261
262
|
# and registers the new channel
|