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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 762f09a19b7978a014083ac04ed2117444bb758f
4
- data.tar.gz: 344636d89975e472df57cef5143ed30a211375be
3
+ metadata.gz: 139ebb751e13d2df736d6ef0f04122a1f91e5c69
4
+ data.tar.gz: 29e474df7db78a0658dfc0b708b7d3928eccb2b1
5
5
  SHA512:
6
- metadata.gz: 9bb978cb0ed74b9835aaeb43105aba2130602a5e841dc968d8f9127cc88a4136b2f8663f6f85feaeac1eec9bf487febd307a8934e816b6fa71397abe5cc5e871
7
- data.tar.gz: 74b9060bb3d673b41565a9167c745578403aefa59f6a644e89730da72bb337dd928788157f54902c11cc3b955678b62a73698c28ffcffc091137bd9cd778cf41
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.map do |channel|
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
@@ -17,7 +17,7 @@ module CelluloidPubsub
17
17
  # minor release version
18
18
  MINOR = 4
19
19
  # tiny release version
20
- TINY = 4
20
+ TINY = 5
21
21
  # prelease version ( set this only if it is a prelease)
22
22
  PRE = nil
23
23
 
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
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-04 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid