celluloid_pubsub 0.4.4 → 0.4.5
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 +3 -3
- data/lib/celluloid_pubsub/redis_reactor.rb +2 -5
- data/lib/celluloid_pubsub/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: 139ebb751e13d2df736d6ef0f04122a1f91e5c69
|
4
|
+
data.tar.gz: 29e474df7db78a0658dfc0b708b7d3928eccb2b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 359d172782df0cb807d8851ef87e261911cafbfc9557dbe0256930ddb3d5f2ce9f8f9ddbcd06cdd51e992dc7855a5f148dd4f6d65916957173d86b5da7560bea
|
7
|
+
data.tar.gz: babfff5d013284b9fa9de8f224b5f9811ef04766405ce29a844f9d4fca9c056eb859e5aa509f82f9db23d491c72f63231b4f5ddcf689784cb122a579cd4a2802
|
@@ -311,7 +311,7 @@ module CelluloidPubsub
|
|
311
311
|
# @api public
|
312
312
|
def publish_event(current_topic, message)
|
313
313
|
return if current_topic.blank? || message.blank?
|
314
|
-
(@server.subscribers[current_topic] || []).each do |hash|
|
314
|
+
(@server.subscribers[current_topic].dup || []).each do |hash|
|
315
315
|
hash[:reactor].websocket << message
|
316
316
|
end
|
317
317
|
rescue => exception
|
@@ -325,7 +325,7 @@ module CelluloidPubsub
|
|
325
325
|
# @api public
|
326
326
|
def unsubscribe_all
|
327
327
|
log_debug "#{self.class} runs 'unsubscribe_all' method"
|
328
|
-
CelluloidPubsub::Registry.channels.
|
328
|
+
CelluloidPubsub::Registry.channels.dup.each do |channel|
|
329
329
|
unsubscribe_clients(channel)
|
330
330
|
end
|
331
331
|
log_debug 'clearing connections'
|
@@ -340,7 +340,7 @@ module CelluloidPubsub
|
|
340
340
|
# @api public
|
341
341
|
def unsubscribe_from_channel(channel)
|
342
342
|
log_debug "#{self.class} runs 'unsubscribe_from_channel' method with #{channel}"
|
343
|
-
(@server.subscribers[channel] || []).each do |hash|
|
343
|
+
(@server.subscribers[channel].dup || []).each do |hash|
|
344
344
|
reactor = hash[:reactor]
|
345
345
|
reactor.websocket.close
|
346
346
|
Celluloid::Actor.kill(reactor)
|
@@ -65,9 +65,6 @@ module CelluloidPubsub
|
|
65
65
|
#
|
66
66
|
# @api public
|
67
67
|
def unsubscribe_all
|
68
|
-
@channels.each do |channel|
|
69
|
-
async.redis_action('unsubscribe', channel)
|
70
|
-
end
|
71
68
|
info 'clearing connections'
|
72
69
|
shutdown
|
73
70
|
end
|
@@ -79,7 +76,7 @@ module CelluloidPubsub
|
|
79
76
|
#
|
80
77
|
# @api public
|
81
78
|
def shutdown
|
82
|
-
@channels.each do |channel|
|
79
|
+
@channels.dup.each do |channel|
|
83
80
|
redis_action('unsubscribe', channel)
|
84
81
|
end if @channels.present?
|
85
82
|
super
|
@@ -246,7 +243,7 @@ module CelluloidPubsub
|
|
246
243
|
def debug_enabled?
|
247
244
|
@server.debug_enabled?
|
248
245
|
end
|
249
|
-
|
246
|
+
|
250
247
|
# method used to register a success callback and if action is subscribe will write
|
251
248
|
# back to the websocket a message that will say it is a successful_subscription
|
252
249
|
# If action is something else, will log the incoming message
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid_pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|