sessionm-cassandra_object 2.4.8 → 2.4.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cassandra_object/async_connection.rb +35 -6
- data/sessionm-cassandra_object.gemspec +1 -1
- metadata +60 -72
@@ -59,17 +59,39 @@ module CassandraObject
|
|
59
59
|
end
|
60
60
|
|
61
61
|
@@schema = nil
|
62
|
-
@@
|
63
|
-
|
64
|
-
|
62
|
+
@@async_connection_pool = nil
|
63
|
+
@@sync_connection_pool = nil
|
64
|
+
def self.async_connection_pool
|
65
|
+
@@async_connection_pool ||=
|
65
66
|
begin
|
66
67
|
adapter_method = Proc.new do
|
67
|
-
|
68
|
+
self.new_event_machine_connection
|
68
69
|
end
|
69
70
|
spec = ActiveRecord::Base::ConnectionSpecification.new self.connection_spec, adapter_method
|
70
|
-
WithConnection::ConnectionPool.new "cassandra", spec
|
71
|
+
WithConnection::ConnectionPool.new "async cassandra", spec
|
71
72
|
end
|
72
73
|
end
|
74
|
+
def async_connection_pool
|
75
|
+
self.class.async_connection_pool
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.sync_connection_pool
|
79
|
+
@@sync_connection_pool ||=
|
80
|
+
begin
|
81
|
+
adapter_method = Proc.new do
|
82
|
+
self.new_connection
|
83
|
+
end
|
84
|
+
spec = ActiveRecord::Base::ConnectionSpecification.new self.connection_spec, adapter_method
|
85
|
+
WithConnection::ConnectionPool.new "sync cassandra", spec
|
86
|
+
end
|
87
|
+
end
|
88
|
+
def sync_connection_pool
|
89
|
+
self.class.sync_connection_pool
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.connection_pool
|
93
|
+
EM.reactor_running? ? self.async_connection_pool : self.sync_connection_pool
|
94
|
+
end
|
73
95
|
def connection_pool
|
74
96
|
self.class.connection_pool
|
75
97
|
end
|
@@ -88,7 +110,14 @@ module CassandraObject
|
|
88
110
|
end
|
89
111
|
|
90
112
|
def self.disconnect!
|
91
|
-
self.
|
113
|
+
self.async_connection_pool.disconnect! if @@async_connection_pool
|
114
|
+
self.sync_connection_pool.disconnect! if @@sync_connection_pool
|
115
|
+
@@sync_connection_pool = nil
|
116
|
+
@@async_connection_pool = nil
|
117
|
+
end
|
118
|
+
|
119
|
+
def disconnect!
|
120
|
+
self.class.disconnect!
|
92
121
|
end
|
93
122
|
|
94
123
|
def connection
|
metadata
CHANGED
@@ -1,75 +1,73 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sessionm-cassandra_object
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 2
|
7
|
-
- 4
|
8
|
-
- 8
|
9
|
-
version: 2.4.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.4.9
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Michael Koziarski
|
13
9
|
- gotime
|
14
10
|
- sessionm
|
15
11
|
autorequire:
|
16
12
|
bindir: bin
|
17
13
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2013-06-05 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
23
17
|
name: rails
|
24
|
-
|
25
|
-
|
26
|
-
requirements:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
27
21
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 0
|
32
|
-
- 9
|
22
|
+
- !ruby/object:Gem::Version
|
33
23
|
version: 3.0.9
|
34
24
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: sessionm-cassandra
|
38
25
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 3.0.9
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: sessionm-cassandra
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
47
39
|
version: 1.0.1
|
48
40
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: bundler
|
52
41
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.1
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: bundler
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
61
55
|
version: 1.0.0
|
62
56
|
type: :development
|
63
|
-
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.0.0
|
64
64
|
description: Cassandra ActiveModel
|
65
65
|
email: klange@sessionm.com
|
66
66
|
executables: []
|
67
|
-
|
68
67
|
extensions: []
|
69
|
-
|
70
|
-
extra_rdoc_files:
|
68
|
+
extra_rdoc_files:
|
71
69
|
- README.markdown
|
72
|
-
files:
|
70
|
+
files:
|
73
71
|
- .gitignore
|
74
72
|
- CHANGELOG
|
75
73
|
- Gemfile
|
@@ -161,41 +159,31 @@ files:
|
|
161
159
|
- test/types/time_type_test.rb
|
162
160
|
- test/types/utf8_string_type_test.rb
|
163
161
|
- test/validations_test.rb
|
164
|
-
has_rdoc: true
|
165
162
|
homepage: http://github.com/sessionm/cassandra_object
|
166
163
|
licenses: []
|
167
|
-
|
168
164
|
post_install_message:
|
169
165
|
rdoc_options: []
|
170
|
-
|
171
|
-
require_paths:
|
166
|
+
require_paths:
|
172
167
|
- lib
|
173
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
- 1
|
179
|
-
- 9
|
180
|
-
- 2
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
181
173
|
version: 1.9.2
|
182
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
- 1
|
188
|
-
- 3
|
189
|
-
- 5
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
176
|
+
requirements:
|
177
|
+
- - ! '>='
|
178
|
+
- !ruby/object:Gem::Version
|
190
179
|
version: 1.3.5
|
191
180
|
requirements: []
|
192
|
-
|
193
181
|
rubyforge_project:
|
194
|
-
rubygems_version: 1.
|
182
|
+
rubygems_version: 1.8.23
|
195
183
|
signing_key:
|
196
184
|
specification_version: 3
|
197
185
|
summary: Cassandra ActiveModel
|
198
|
-
test_files:
|
186
|
+
test_files:
|
199
187
|
- test/README
|
200
188
|
- test/active_model_test.rb
|
201
189
|
- test/attributes_test.rb
|