celluloid-presence 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6998809bec194e766affe68b154c278e14dcf7a
|
4
|
+
data.tar.gz: 9677bc36716a54c69ad3d41326fca27023b2dbcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c0130e9cfebbf6c4ede62d736670dd906043a0e95b9db90d2b084005abb1375d66169a003d9596cc8ab9801a6fd05ca7b8f96713698089d30f15d9aec026c2
|
7
|
+
data.tar.gz: 4cf855776dc52f4fdde0263049d652388f4e6bdbdf9b93afe8d0b7e20cc53867eac83a510c5cfbed267410aacde4417d8aec06b3887e209dbc7b5e9aeaf42253
|
data/README.textile
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
h1. Celluloid Presence
|
2
2
|
|
3
|
-
Start an instance of "ZooKeeper":http://zookeeper.apache.org/ on your
|
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-
|
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
|
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
|
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'
|
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.
|
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-
|
11
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|