zk 1.1.1 → 1.2.0
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.
- data/.gitignore +1 -0
- data/.gitmodules +3 -0
- data/.travis.yml +5 -1
- data/.yardopts +0 -1
- data/Gemfile +15 -0
- data/README.markdown +46 -76
- data/RELEASES.markdown +18 -0
- data/Rakefile +46 -65
- data/lib/zk.rb +5 -0
- data/lib/zk/client/base.rb +33 -20
- data/lib/zk/client/unixisms.rb +7 -7
- data/lib/zk/core_ext.rb +26 -0
- data/lib/zk/event.rb +5 -5
- data/lib/zk/event_handler.rb +2 -2
- data/lib/zk/event_handler_subscription/actor.rb +1 -13
- data/lib/zk/event_handler_subscription/base.rb +15 -15
- data/lib/zk/exceptions.rb +3 -0
- data/lib/zk/extensions.rb +8 -37
- data/lib/zk/locker.rb +8 -0
- data/lib/zk/locker/exclusive_locker.rb +25 -12
- data/lib/zk/locker/locker_base.rb +124 -21
- data/lib/zk/locker/shared_locker.rb +34 -22
- data/lib/zk/stat.rb +2 -2
- data/lib/zk/subscription.rb +65 -0
- data/lib/zk/version.rb +1 -1
- data/notes/documentation-notes +20 -0
- data/notes/voting-notes.txt +39 -0
- data/spec/event_catcher_spec.rb +5 -2
- data/spec/informal/close-in-event-thread.rb +1 -1
- data/spec/shared/client_examples.rb +1 -1
- data/spec/spec_helper.rb +8 -1
- data/spec/support/event_catcher.rb +6 -6
- data/spec/support/latch.rb +23 -0
- data/spec/support/logging.rb +1 -1
- data/spec/watch_spec.rb +1 -1
- data/spec/zk/client/locking_and_session_death_spec.rb +7 -7
- data/spec/zk/locker_spec.rb +177 -62
- data/spec/zookeeper_spec.rb +2 -2
- data/zk.gemspec +3 -1
- metadata +34 -10
data/spec/zookeeper_spec.rb
CHANGED
@@ -62,7 +62,7 @@ shared_examples_for 'ZK basic' do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should return a stat" do
|
65
|
-
@zk.stat("#{@base_path}/test").should be_instance_of(
|
65
|
+
@zk.stat("#{@base_path}/test").should be_instance_of(Zookeeper::Stat)
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should return a boolean" do
|
@@ -72,7 +72,7 @@ shared_examples_for 'ZK basic' do
|
|
72
72
|
it "should get data and stat" do
|
73
73
|
data, stat = @zk.get("#{@base_path}/test")
|
74
74
|
data.should == "test_data"
|
75
|
-
stat.should be_a_kind_of(
|
75
|
+
stat.should be_a_kind_of(Zookeeper::Stat)
|
76
76
|
stat.created_time.should_not == 0
|
77
77
|
end
|
78
78
|
|
data/zk.gemspec
CHANGED
@@ -12,7 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{A high-level wrapper around the zookeeper driver}
|
13
13
|
s.description = s.summary + "\n"
|
14
14
|
|
15
|
-
|
15
|
+
# s.add_runtime_dependency 'slyphon-zookeeper', '~> 1.0.0'
|
16
|
+
s.add_runtime_dependency 'zookeeper', '~> 1.0.0.beta.1'
|
17
|
+
s.add_runtime_dependency 'backports', '~> 2.5.1'
|
16
18
|
|
17
19
|
s.files = `git ls-files`.split("\n")
|
18
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan D. Simms
|
@@ -16,24 +16,42 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-05-
|
19
|
+
date: 2012-05-07 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: zookeeper
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 1711417137
|
30
30
|
segments:
|
31
|
+
- 1
|
31
32
|
- 0
|
32
|
-
-
|
33
|
-
-
|
34
|
-
|
33
|
+
- 0
|
34
|
+
- beta
|
35
|
+
- 1
|
36
|
+
version: 1.0.0.beta.1
|
35
37
|
type: :runtime
|
36
38
|
version_requirements: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: backports
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 25
|
48
|
+
segments:
|
49
|
+
- 2
|
50
|
+
- 5
|
51
|
+
- 1
|
52
|
+
version: 2.5.1
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
37
55
|
description: |
|
38
56
|
A high-level wrapper around the zookeeper driver
|
39
57
|
|
@@ -50,6 +68,7 @@ files:
|
|
50
68
|
- .dotfiles/rspec-logging
|
51
69
|
- .dotfiles/rvmrc
|
52
70
|
- .gitignore
|
71
|
+
- .gitmodules
|
53
72
|
- .travis.yml
|
54
73
|
- .yardopts
|
55
74
|
- Gemfile
|
@@ -86,9 +105,12 @@ files:
|
|
86
105
|
- lib/zk/mongoid.rb
|
87
106
|
- lib/zk/pool.rb
|
88
107
|
- lib/zk/stat.rb
|
108
|
+
- lib/zk/subscription.rb
|
89
109
|
- lib/zk/threaded_callback.rb
|
90
110
|
- lib/zk/threadpool.rb
|
91
111
|
- lib/zk/version.rb
|
112
|
+
- notes/documentation-notes
|
113
|
+
- notes/voting-notes.txt
|
92
114
|
- spec/event_catcher_spec.rb
|
93
115
|
- spec/informal/close-in-event-thread.rb
|
94
116
|
- spec/informal/lock_with_dead_session.rb
|
@@ -102,6 +124,7 @@ files:
|
|
102
124
|
- spec/support/bogus_mongoid.rb
|
103
125
|
- spec/support/event_catcher.rb
|
104
126
|
- spec/support/exist_matcher.rb
|
127
|
+
- spec/support/latch.rb
|
105
128
|
- spec/support/logging.rb
|
106
129
|
- spec/support/logging_progress_bar_formatter.rb
|
107
130
|
- spec/support/pendings.rb
|
@@ -168,6 +191,7 @@ test_files:
|
|
168
191
|
- spec/support/bogus_mongoid.rb
|
169
192
|
- spec/support/event_catcher.rb
|
170
193
|
- spec/support/exist_matcher.rb
|
194
|
+
- spec/support/latch.rb
|
171
195
|
- spec/support/logging.rb
|
172
196
|
- spec/support/logging_progress_bar_formatter.rb
|
173
197
|
- spec/support/pendings.rb
|