celluloid-presence 1.0.0 → 1.0.1

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: 83c3287a94c2f820bab2be50041e10183562379d
4
- data.tar.gz: 5e94a2416dcaca6535a64291eb525b5117a8d338
3
+ metadata.gz: b6998809bec194e766affe68b154c278e14dcf7a
4
+ data.tar.gz: 9677bc36716a54c69ad3d41326fca27023b2dbcd
5
5
  SHA512:
6
- metadata.gz: c90b5508fc1281b5f3713b87c9a980b89e9e46728db5efdd53ca782fe10393c560d78901a0b0707fcb154d6eb0320b314f4e84edaf81790e8296583210821eff
7
- data.tar.gz: 979c29216afcd3a3d958f8ee6625cfb91e7bcedb47d45d75ffad5675e0b2de0a9a9ff82d9091552c1e14ebe129bc1e51917dd6fe70f0d10a7aa8d514029356bb
6
+ metadata.gz: c0c0130e9cfebbf6c4ede62d736670dd906043a0e95b9db90d2b084005abb1375d66169a003d9596cc8ab9801a6fd05ca7b8f96713698089d30f15d9aec026c2
7
+ data.tar.gz: 4cf855776dc52f4fdde0263049d652388f4e6bdbdf9b93afe8d0b7e20cc53867eac83a510c5cfbed267410aacde4417d8aec06b3887e209dbc7b5e9aeaf42253
@@ -1,8 +1,6 @@
1
1
  h1. Celluloid Presence
2
2
 
3
- Start an instance of "ZooKeeper":http://zookeeper.apache.org/ on your server then run:
4
- * OSX:
5
- *
3
+ Start an instance of "ZooKeeper":http://zookeeper.apache.org/ on your dev machine then run:
6
4
 
7
5
  <pre><code class="ruby">
8
6
  require 'rubygems'
@@ -46,6 +44,6 @@ Messaging.run(:presence)
46
44
 
47
45
  h2. Start using it now
48
46
 
49
- # Read the "Documentation":http://rubydoc.info/gems/celluloid-promise/Celluloid/Presence
47
+ # Read the "Documentation":http://rubydoc.info/gems/celluloid-presence/Celluloid/Presence
50
48
  # Then @gem install celluloid-presence@
51
49
 
@@ -41,7 +41,7 @@ module Celluloid
41
41
  subscribe('zk_connected', :on_connected)
42
42
  subscribe('zk_connecting', :on_connecting)
43
43
 
44
- on_connected if zk.connected?
44
+ on_connected
45
45
  end
46
46
 
47
47
 
@@ -61,7 +61,7 @@ module Celluloid
61
61
  @nodes = zk.children(@base_path, :watch => true) # re-set watch
62
62
  update_node_information
63
63
  rescue ZK::Exceptions::NoNode # Technically this shouldn't happen unless someone deleted our base path
64
- on_connected if zk.connected?
64
+ on_connected
65
65
  end
66
66
  end
67
67
  end
@@ -70,6 +70,8 @@ module Celluloid
70
70
  # This informs us of a new connection being established with zookeeper
71
71
  #
72
72
  def on_connected(event = nil)
73
+ return unless zk.connected?
74
+
73
75
  address = @node_address.call
74
76
  if @node_path.nil? or not zk.exists?(@node_path) # Create presence node as it doesn't exist
75
77
  #p 'node re-created'
@@ -1,6 +1,6 @@
1
1
  module Celluloid
2
2
  module Presence
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
6
6
 
@@ -60,6 +60,8 @@ module DCell
60
60
 
61
61
 
62
62
  def update_directory(new_list)
63
+ new_list ||= []
64
+
63
65
  unsubscribe = @nodes - new_list # TODO:: use sets here instead of arrays for speed
64
66
  subscribe = new_list - @nodes
65
67
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid-presence
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-26 00:00:00.000000000 Z
11
+ date: 2013-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid