tengine_core 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile.lock +60 -40
- data/examples/uc20_fire_with_properties.rb~ +16 -0
- data/examples/uc21_fire_with_same_key.rb~ +19 -0
- data/examples/uc22_fire_with_source_name.rb~ +19 -0
- data/examples/uc23_fire_with_level.rb~ +19 -0
- data/examples/uc24_fire_with_level_key.rb~ +20 -0
- data/examples/uc30_local_variables.rb~ +16 -0
- data/examples/uc31_instance_variables.rb~ +16 -0
- data/examples/uc32_class_variables.rb~ +16 -0
- data/examples/uc33_statics.rb~ +16 -0
- data/lib/tengine/core/config.rb +1 -0
- data/lib/tengine/core/config/atd.rb +2 -7
- data/lib/tengine/core/config/core.rb +3 -7
- data/lib/tengine/core/config/db.rb +18 -0
- data/lib/tengine/core/config/heartbeat_watcher.rb +2 -7
- data/lib/tengine/core/driveable.rb +14 -2
- data/lib/tengine/core/driver.rb +1 -0
- data/lib/tengine/core/optimistic_lock.rb +30 -8
- metadata +70 -69
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjZmNGRmNDNiYzQ3MGE3ZWMzMGE3MTZhZDcyMWM5YjkxODRkMGM2ZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Mzg3ZDY0N2FmNmQxNTBkZGI2MDcwNmRkZjJiN2NmY2Q4YjkwZWJjOA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MmE4OTNhNmMzNTY2MTBmMjMwYmYyYWMzZjQyNjBiMDhmOTFhNDA0MGZkZDYx
|
10
|
+
OGQwMzcwNTI5MjJlMWYxNGZmNzUyNzY1NWFmZDhiZTg2MWQwYmVhZmNlZjYx
|
11
|
+
NTA0NDA2MTRkMDUwYmE4NjUzODI2NjQ1MDUxMGYwY2E0OTQ1OWQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NGMyOTEwNWVlMTQzZDU3YzcxYjgzMmIyZWNmNDg2OWNiMDIzZjZmMmVkNTkw
|
14
|
+
NWZlNWI1ZWExNDdlNjQxMmY2ZGI5YzdiY2Q1MmE5MmNkNWQ1YTA1ZWE2Y2Nj
|
15
|
+
Y2U1ZjJjODMzMDFkZDU1ZDM1MTllZTg2Y2FlNzc5NDMyMTQxOGE=
|
data/Gemfile.lock
CHANGED
@@ -1,55 +1,72 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tengine_core (1.
|
4
|
+
tengine_core (1.2.0)
|
5
5
|
activemodel (>= 3.1.0)
|
6
6
|
activesupport (>= 3.1.0)
|
7
7
|
daemons (~> 1.1.4)
|
8
|
-
mongoid (
|
8
|
+
mongoid (>= 3.0.22)
|
9
9
|
selectable_attr (~> 0.3.15)
|
10
|
-
tengine_event (~> 1.
|
11
|
-
tengine_support (~> 1.
|
10
|
+
tengine_event (~> 1.2.0)
|
11
|
+
tengine_support (~> 1.2.0)
|
12
12
|
|
13
13
|
GEM
|
14
14
|
remote: http://rubygems.org/
|
15
15
|
specs:
|
16
|
-
ZenTest (4.
|
17
|
-
activemodel (3.2.
|
18
|
-
activesupport (= 3.2.
|
16
|
+
ZenTest (4.9.1)
|
17
|
+
activemodel (3.2.13)
|
18
|
+
activesupport (= 3.2.13)
|
19
19
|
builder (~> 3.0.0)
|
20
|
-
activesupport (3.2.
|
21
|
-
i18n (
|
20
|
+
activesupport (3.2.13)
|
21
|
+
i18n (= 0.6.1)
|
22
22
|
multi_json (~> 1.0)
|
23
|
-
amq-client (0.
|
24
|
-
amq-protocol (>=
|
23
|
+
amq-client (0.9.12)
|
24
|
+
amq-protocol (>= 1.2.0)
|
25
25
|
eventmachine
|
26
|
-
amq-protocol (
|
27
|
-
amqp (0.
|
28
|
-
amq-client (~> 0.
|
29
|
-
amq-protocol (~>
|
26
|
+
amq-protocol (1.2.0)
|
27
|
+
amqp (0.9.10)
|
28
|
+
amq-client (~> 0.9.12)
|
29
|
+
amq-protocol (~> 1.2.0)
|
30
30
|
eventmachine
|
31
31
|
autotest (4.4.6)
|
32
32
|
ZenTest (>= 4.4.1)
|
33
33
|
builder (3.0.4)
|
34
|
+
coderay (1.0.9)
|
35
|
+
columnize (0.3.6)
|
34
36
|
daemons (1.1.9)
|
37
|
+
debugger (1.5.0)
|
38
|
+
columnize (>= 0.3.1)
|
39
|
+
debugger-linecache (~> 1.2.0)
|
40
|
+
debugger-ruby_core_source (~> 1.2.0)
|
41
|
+
debugger-linecache (1.2.0)
|
42
|
+
debugger-ruby_core_source (1.2.0)
|
35
43
|
diff-lcs (1.1.3)
|
36
|
-
eventmachine (1.0.
|
44
|
+
eventmachine (1.0.3)
|
37
45
|
factory_girl (3.3.0)
|
38
46
|
activesupport (>= 3.0.0)
|
39
47
|
i18n (0.6.1)
|
40
|
-
kramdown (0.14.0)
|
41
48
|
macaddr (1.6.1)
|
42
49
|
systemu (~> 2.5.0)
|
43
|
-
|
44
|
-
|
45
|
-
|
50
|
+
method_source (0.8.1)
|
51
|
+
mongoid (3.1.3)
|
52
|
+
activemodel (~> 3.2)
|
53
|
+
moped (~> 1.4.2)
|
46
54
|
origin (~> 1.0)
|
47
55
|
tzinfo (~> 0.3.22)
|
48
|
-
moped (1.
|
49
|
-
multi_json (1.
|
50
|
-
origin (1.0
|
51
|
-
|
52
|
-
|
56
|
+
moped (1.4.5)
|
57
|
+
multi_json (1.7.2)
|
58
|
+
origin (1.1.0)
|
59
|
+
pry (0.9.12.1)
|
60
|
+
coderay (~> 1.0.5)
|
61
|
+
method_source (~> 0.8)
|
62
|
+
slop (~> 3.4)
|
63
|
+
pry-debugger (0.2.2)
|
64
|
+
debugger (~> 1.3)
|
65
|
+
pry (~> 0.9.10)
|
66
|
+
pry-doc (0.4.5)
|
67
|
+
pry (>= 0.9)
|
68
|
+
yard (>= 0.8)
|
69
|
+
rake (10.0.4)
|
53
70
|
rspec (2.10.0)
|
54
71
|
rspec-core (~> 2.10.0)
|
55
72
|
rspec-expectations (~> 2.10.0)
|
@@ -60,34 +77,37 @@ GEM
|
|
60
77
|
rspec-mocks (2.10.1)
|
61
78
|
selectable_attr (0.3.17)
|
62
79
|
i18n
|
63
|
-
simplecov (0.
|
80
|
+
simplecov (0.7.1)
|
64
81
|
multi_json (~> 1.0)
|
65
|
-
simplecov-html (~> 0.
|
66
|
-
simplecov-html (0.
|
82
|
+
simplecov-html (~> 0.7.1)
|
83
|
+
simplecov-html (0.7.1)
|
84
|
+
slop (3.4.4)
|
67
85
|
systemu (2.5.2)
|
68
|
-
tengine_event (1.
|
86
|
+
tengine_event (1.2.0)
|
69
87
|
activesupport (>= 3.0.0)
|
70
|
-
amqp (~> 0.
|
71
|
-
tengine_support (~> 1.
|
88
|
+
amqp (~> 0.9.10)
|
89
|
+
tengine_support (~> 1.2.0)
|
72
90
|
uuid (~> 2.3.4)
|
73
|
-
tengine_support (1.
|
91
|
+
tengine_support (1.2.0)
|
74
92
|
activesupport (>= 3.0.0)
|
75
|
-
tzinfo (0.3.
|
76
|
-
uuid (2.3.
|
93
|
+
tzinfo (0.3.37)
|
94
|
+
uuid (2.3.7)
|
77
95
|
macaddr (~> 1.0)
|
78
|
-
yard (0.8.
|
96
|
+
yard (0.8.6.1)
|
79
97
|
|
80
98
|
PLATFORMS
|
81
99
|
ruby
|
82
100
|
|
83
101
|
DEPENDENCIES
|
102
|
+
ZenTest (~> 4.9.0)
|
84
103
|
autotest
|
85
104
|
bundler
|
86
105
|
factory_girl (~> 3.3.0)
|
87
|
-
|
88
|
-
|
89
|
-
|
106
|
+
pry
|
107
|
+
pry-debugger
|
108
|
+
pry-doc
|
109
|
+
rake
|
90
110
|
rspec (~> 2.10.0)
|
91
|
-
simplecov
|
111
|
+
simplecov
|
92
112
|
tengine_core!
|
93
|
-
yard
|
113
|
+
yard
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/core'
|
3
|
+
|
4
|
+
driver :driver20 do
|
5
|
+
|
6
|
+
# イベントが発生したら:propertiesを指定してイベントを発火する
|
7
|
+
on:event20_1 do
|
8
|
+
puts "handler20_1"
|
9
|
+
fire(:event20_2, :properties => {:foo => :bar, :baz => 1})
|
10
|
+
end
|
11
|
+
|
12
|
+
on:event02_2 do
|
13
|
+
puts "handler02_2"
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'tengine/core'
|
4
|
+
|
5
|
+
driver :driver20 do
|
6
|
+
|
7
|
+
# イベントが発生したら:propertiesを指定してイベントを発火する
|
8
|
+
on:event20_1 do
|
9
|
+
puts "handler20_1"
|
10
|
+
fire(:event20_2, :properties => {:foo => 'bar', :baz => 1})
|
11
|
+
end
|
12
|
+
|
13
|
+
on:event20_2 do
|
14
|
+
puts event[:foo].inspect
|
15
|
+
puts event[:baz].inspect
|
16
|
+
puts event.properties.inspect
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'tengine/core'
|
4
|
+
|
5
|
+
driver :driver20 do
|
6
|
+
|
7
|
+
# イベントが発生したら:propertiesを指定してイベントを発火する
|
8
|
+
on:event20_1 do
|
9
|
+
puts "handler20_1"
|
10
|
+
fire(:event20_2, :properties => {:foo => 'bar', :baz => 1})
|
11
|
+
end
|
12
|
+
|
13
|
+
on:event20_2 do
|
14
|
+
puts event[:foo].inspect
|
15
|
+
puts event[:baz].inspect
|
16
|
+
puts event.properties.inspect
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'tengine/core'
|
4
|
+
|
5
|
+
driver :driver20 do
|
6
|
+
|
7
|
+
# イベントが発生したら:propertiesを指定してイベントを発火する
|
8
|
+
on:event20_1 do
|
9
|
+
puts "handler20_1"
|
10
|
+
fire(:event20_2, :properties => {:foo => 'bar', :baz => 1})
|
11
|
+
end
|
12
|
+
|
13
|
+
on:event20_2 do
|
14
|
+
puts event[:foo].inspect
|
15
|
+
puts event[:baz].inspect
|
16
|
+
puts event.properties.inspect
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'tengine/core'
|
4
|
+
|
5
|
+
driver :driver23 do
|
6
|
+
|
7
|
+
# イベントが発生したら:propertiesを指定してイベントを発火する
|
8
|
+
on:event23 do
|
9
|
+
puts "handler23"
|
10
|
+
fire(:event23_0, :level => 0)
|
11
|
+
end
|
12
|
+
|
13
|
+
on(:event23_0){ puts "handler23_0"; fire(:event23_1, :level => 1) }
|
14
|
+
on(:event23_1){ puts "handler23_1"; fire(:event23_2, :level => 2) }
|
15
|
+
on(:event23_2){ puts "handler23_2"; fire(:event23_3, :level => 3) }
|
16
|
+
on(:event23_3){ puts "handler23_3"; fire(:event23_4, :level => 4) }
|
17
|
+
on(:event23_4){ puts "handler23_4"; fire(:event23_5, :level => 5) }
|
18
|
+
on(:event23_5){ puts "handler23_5"; fire(:event23_6, :level => 6) } # [ArgumentError] Invalid level value. It must be one of [0, 1, 2, 3, 4, 5]
|
19
|
+
on(:event23_6){ puts "handler23_6" }
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/core'
|
3
|
+
|
4
|
+
lvar1 = "outside of driver"
|
5
|
+
|
6
|
+
driver :driver30 do
|
7
|
+
|
8
|
+
lvar2 = "outside of handler"
|
9
|
+
|
10
|
+
# イベントに対応する処理の実行する
|
11
|
+
on:event30 do
|
12
|
+
puts lvar1 # => outside of driver
|
13
|
+
puts lvar2 # => outside of handler
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/core'
|
3
|
+
|
4
|
+
lvar1 = "outside of driver"
|
5
|
+
|
6
|
+
driver :driver30 do
|
7
|
+
|
8
|
+
lvar2 = "outside of handler"
|
9
|
+
|
10
|
+
# イベントに対応する処理の実行する
|
11
|
+
on:event30 do
|
12
|
+
puts lvar1 # => outside of driver
|
13
|
+
puts lvar2 # => outside of handler
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/core'
|
3
|
+
|
4
|
+
lvar1 = "outside of driver"
|
5
|
+
|
6
|
+
driver :driver30 do
|
7
|
+
|
8
|
+
lvar2 = "outside of handler"
|
9
|
+
|
10
|
+
# イベントに対応する処理の実行する
|
11
|
+
on:event30 do
|
12
|
+
puts lvar1 # => outside of driver
|
13
|
+
puts lvar2 # => outside of handler
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/core'
|
3
|
+
|
4
|
+
lvar1 = "outside of driver"
|
5
|
+
|
6
|
+
driver :driver30 do
|
7
|
+
|
8
|
+
lvar2 = "outside of handler"
|
9
|
+
|
10
|
+
# イベントに対応する処理の実行する
|
11
|
+
on:event30 do
|
12
|
+
puts lvar1 # => outside of driver
|
13
|
+
puts lvar2 # => outside of handler
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/lib/tengine/core/config.rb
CHANGED
@@ -85,13 +85,8 @@ EOS
|
|
85
85
|
load_config(:config, "path/to/config_file", :type => :string)
|
86
86
|
|
87
87
|
add(:process, Tengine::Core::Config::Atd::Process)
|
88
|
-
field(:db, "settings to connect to db", :type => :hash,
|
89
|
-
|
90
|
-
'port' => 27017,
|
91
|
-
'username' => nil,
|
92
|
-
'password' => nil,
|
93
|
-
'database' => 'tengine_production',
|
94
|
-
})
|
88
|
+
field(:db, "settings to connect to db", :type => :hash,
|
89
|
+
:default => Tengine::Core::Config::DB::DEFAULT_SETTINGS)
|
95
90
|
|
96
91
|
group(:heartbeat) do
|
97
92
|
add(:atd , Tengine::Core::Config::Core::Heartbeat)
|
@@ -86,13 +86,8 @@ EOS
|
|
86
86
|
|
87
87
|
add(:process, Tengine::Core::Config::Core::Process)
|
88
88
|
add(:tengined, Tengine::Core::Config::Core::Tengined)
|
89
|
-
field(:db, "settings to connect to db", :type => :hash,
|
90
|
-
|
91
|
-
'port' => 27017,
|
92
|
-
'username' => nil,
|
93
|
-
'password' => nil,
|
94
|
-
'database' => 'tengine_production',
|
95
|
-
})
|
89
|
+
field(:db, "settings to connect to db", :type => :hash,
|
90
|
+
:default => Tengine::Core::Config::DB::DEFAULT_SETTINGS)
|
96
91
|
|
97
92
|
group(:event_queue, :hidden => true) do
|
98
93
|
add(:connection, AmqpConnection)
|
@@ -143,6 +138,7 @@ EOS
|
|
143
138
|
[:config] => :f,
|
144
139
|
[:tengined, :daemon] => :D,
|
145
140
|
[:tengined, :load_path] => :T,
|
141
|
+
[:tengined, :cache_drivers] => :c,
|
146
142
|
# [:tengined, :heartbeat_period] => :G,
|
147
143
|
[:tengined, :confirmation_threshold] => :C,
|
148
144
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'tengine/core/config'
|
2
|
+
|
3
|
+
module Tengine::Core::Config::DB
|
4
|
+
|
5
|
+
DEFAULT_SETTINGS = {
|
6
|
+
"sessions"=>{
|
7
|
+
"default"=>{
|
8
|
+
"database"=>"tengine_production",
|
9
|
+
"hosts"=>["localhost:27017"],
|
10
|
+
"options"=>{
|
11
|
+
"safe"=>true,
|
12
|
+
"consistency"=>:strong
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}.freeze
|
17
|
+
|
18
|
+
end
|
@@ -85,13 +85,8 @@ EOS
|
|
85
85
|
load_config(:config, "path/to/config_file", :type => :string)
|
86
86
|
|
87
87
|
add(:process, Tengine::Core::Config::HeartbeatWatcher::Process)
|
88
|
-
field(:db, "settings to connect to db", :type => :hash,
|
89
|
-
|
90
|
-
'port' => 27017,
|
91
|
-
'username' => nil,
|
92
|
-
'password' => nil,
|
93
|
-
'database' => 'tengine_production',
|
94
|
-
})
|
88
|
+
field(:db, "settings to connect to db", :type => :hash,
|
89
|
+
:default => Tengine::Core::Config::DB::DEFAULT_SETTINGS)
|
95
90
|
|
96
91
|
group(:heartbeat) do
|
97
92
|
add(:core , Tengine::Core::Config::Core::Heartbeat)
|
@@ -53,7 +53,7 @@ module Tengine::Core::Driveable
|
|
53
53
|
@__context__.__on_args__ = nil
|
54
54
|
return unless @__context__.__creating_driver__
|
55
55
|
driver = @__context__.driver
|
56
|
-
driver
|
56
|
+
reload_driver_with_cache_message_if_need(driver)
|
57
57
|
options = args.extract_options!
|
58
58
|
handler = driver.handlers.create!({
|
59
59
|
:event_type_names => args,
|
@@ -78,7 +78,7 @@ module Tengine::Core::Driveable
|
|
78
78
|
context.__on_args__ = nil
|
79
79
|
return unless @__context__.__creating_driver__
|
80
80
|
driver = context.driver
|
81
|
-
driver
|
81
|
+
reload_driver_with_cache_message_if_need(driver)
|
82
82
|
options = args.extract_options!
|
83
83
|
handler = driver.handlers.create!({
|
84
84
|
:event_type_names => args,
|
@@ -90,6 +90,18 @@ module Tengine::Core::Driveable
|
|
90
90
|
driver.handler_paths.create!(:event_type_name => event_type_name, :handler_id => handler.id)
|
91
91
|
end
|
92
92
|
end
|
93
|
+
|
94
|
+
# --tengined-cache-driversオプションを指定せずに複数のtenginedプロセスを起動すると
|
95
|
+
# ドライバのリロードに失敗することがあるため、複数プロセスを起動する際には、
|
96
|
+
# --tengined-cache-driversオプションを指定するようにメッセージを出力します。
|
97
|
+
def self.reload_driver_with_cache_message_if_need(driver)
|
98
|
+
begin
|
99
|
+
driver.reload
|
100
|
+
rescue Mongoid::Errors::DocumentNotFound => e
|
101
|
+
Tengine::Core.stderr_logger.error("[#{Process.pid}] failed to reload driver. Use --tengined-cache-drivers option if you execute multiple tengined processes. driver : #{driver.inspect}. ")
|
102
|
+
raise e
|
103
|
+
end
|
104
|
+
end
|
93
105
|
end
|
94
106
|
|
95
107
|
module ClassMethods
|
data/lib/tengine/core/driver.rb
CHANGED
@@ -44,6 +44,7 @@ class Tengine::Core::Driver
|
|
44
44
|
validates :version, :presence => true
|
45
45
|
|
46
46
|
embeds_many :handlers, :class_name => "Tengine::Core::Handler"
|
47
|
+
accepts_nested_attributes_for :handlers
|
47
48
|
|
48
49
|
belongs_to :session, :index => true, :class_name => "Tengine::Core::Session"
|
49
50
|
has_many :handler_paths, :class_name => "Tengine::Core::HandlerPath"
|
@@ -19,16 +19,38 @@ module Tengine::Core::OptimisticLock
|
|
19
19
|
class RetryOverError < StandardError
|
20
20
|
end
|
21
21
|
|
22
|
+
class << self
|
23
|
+
def update_with_lock_stack
|
24
|
+
@update_with_lock_stack ||= []
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
DEFAULT_RETRY_COUNT = (ENV['TENGINE_OPTIMISTIC_LOCK_RETRY_MAX'] || 5).to_i
|
29
|
+
|
22
30
|
def update_with_lock(options = {})
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
unless Tengine::Core::OptimisticLock.update_with_lock_stack.empty?
|
32
|
+
Tengine.logger.warn("Tengine::Core::OptimisticLock#update_with_lock is used in another #update_with_lock.\n " << caller.join("\n "))
|
33
|
+
Tengine::Core::OptimisticLock.update_with_lock_stack.each do |obj|
|
34
|
+
Tengine.logger.warn("-" * 100)
|
35
|
+
Tengine.logger.warn("invocation from: #{obj}")
|
36
|
+
end
|
37
|
+
Tengine.logger.warn("-" * 100)
|
38
|
+
Tengine.logger.warn("and invocation from: #{self.inspect}")
|
39
|
+
end
|
40
|
+
Tengine::Core::OptimisticLock.update_with_lock_stack.push(self.inspect)
|
41
|
+
begin
|
42
|
+
retry_count = options[:retry] || DEFAULT_RETRY_COUNT
|
43
|
+
idx = 1
|
44
|
+
while idx <= retry_count
|
45
|
+
yield
|
46
|
+
return if __update_with_lock__
|
47
|
+
reload
|
48
|
+
idx += 1
|
49
|
+
end
|
50
|
+
raise RetryOverError, "retried #{retry_count} times but failed to update"
|
51
|
+
ensure
|
52
|
+
Tengine::Core::OptimisticLock.update_with_lock_stack.pop
|
30
53
|
end
|
31
|
-
raise RetryOverError, "retried #{retry_count} times but failed to update"
|
32
54
|
end
|
33
55
|
|
34
56
|
def __update_with_lock__
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tengine_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- taigou
|
@@ -14,12 +13,11 @@ authors:
|
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
|
-
date:
|
16
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
18
17
|
dependencies:
|
19
18
|
- !ruby/object:Gem::Dependency
|
20
19
|
name: activesupport
|
21
20
|
requirement: !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
21
|
requirements:
|
24
22
|
- - ! '>='
|
25
23
|
- !ruby/object:Gem::Version
|
@@ -27,7 +25,6 @@ dependencies:
|
|
27
25
|
type: :runtime
|
28
26
|
prerelease: false
|
29
27
|
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
none: false
|
31
28
|
requirements:
|
32
29
|
- - ! '>='
|
33
30
|
- !ruby/object:Gem::Version
|
@@ -35,7 +32,6 @@ dependencies:
|
|
35
32
|
- !ruby/object:Gem::Dependency
|
36
33
|
name: activemodel
|
37
34
|
requirement: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
35
|
requirements:
|
40
36
|
- - ! '>='
|
41
37
|
- !ruby/object:Gem::Version
|
@@ -43,7 +39,6 @@ dependencies:
|
|
43
39
|
type: :runtime
|
44
40
|
prerelease: false
|
45
41
|
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
42
|
requirements:
|
48
43
|
- - ! '>='
|
49
44
|
- !ruby/object:Gem::Version
|
@@ -51,7 +46,6 @@ dependencies:
|
|
51
46
|
- !ruby/object:Gem::Dependency
|
52
47
|
name: selectable_attr
|
53
48
|
requirement: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
49
|
requirements:
|
56
50
|
- - ~>
|
57
51
|
- !ruby/object:Gem::Version
|
@@ -59,7 +53,6 @@ dependencies:
|
|
59
53
|
type: :runtime
|
60
54
|
prerelease: false
|
61
55
|
version_requirements: !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
56
|
requirements:
|
64
57
|
- - ~>
|
65
58
|
- !ruby/object:Gem::Version
|
@@ -67,55 +60,48 @@ dependencies:
|
|
67
60
|
- !ruby/object:Gem::Dependency
|
68
61
|
name: mongoid
|
69
62
|
requirement: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
63
|
requirements:
|
72
|
-
- -
|
64
|
+
- - ! '>='
|
73
65
|
- !ruby/object:Gem::Version
|
74
|
-
version: 3.0.
|
66
|
+
version: 3.0.22
|
75
67
|
type: :runtime
|
76
68
|
prerelease: false
|
77
69
|
version_requirements: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
70
|
requirements:
|
80
|
-
- -
|
71
|
+
- - ! '>='
|
81
72
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.0.
|
73
|
+
version: 3.0.22
|
83
74
|
- !ruby/object:Gem::Dependency
|
84
75
|
name: tengine_support
|
85
76
|
requirement: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
77
|
requirements:
|
88
78
|
- - ~>
|
89
79
|
- !ruby/object:Gem::Version
|
90
|
-
version: 1.
|
80
|
+
version: 1.2.0
|
91
81
|
type: :runtime
|
92
82
|
prerelease: false
|
93
83
|
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
84
|
requirements:
|
96
85
|
- - ~>
|
97
86
|
- !ruby/object:Gem::Version
|
98
|
-
version: 1.
|
87
|
+
version: 1.2.0
|
99
88
|
- !ruby/object:Gem::Dependency
|
100
89
|
name: tengine_event
|
101
90
|
requirement: !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
91
|
requirements:
|
104
92
|
- - ~>
|
105
93
|
- !ruby/object:Gem::Version
|
106
|
-
version: 1.
|
94
|
+
version: 1.2.0
|
107
95
|
type: :runtime
|
108
96
|
prerelease: false
|
109
97
|
version_requirements: !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
98
|
requirements:
|
112
99
|
- - ~>
|
113
100
|
- !ruby/object:Gem::Version
|
114
|
-
version: 1.
|
101
|
+
version: 1.2.0
|
115
102
|
- !ruby/object:Gem::Dependency
|
116
103
|
name: daemons
|
117
104
|
requirement: !ruby/object:Gem::Requirement
|
118
|
-
none: false
|
119
105
|
requirements:
|
120
106
|
- - ~>
|
121
107
|
- !ruby/object:Gem::Version
|
@@ -123,7 +109,6 @@ dependencies:
|
|
123
109
|
type: :runtime
|
124
110
|
prerelease: false
|
125
111
|
version_requirements: !ruby/object:Gem::Requirement
|
126
|
-
none: false
|
127
112
|
requirements:
|
128
113
|
- - ~>
|
129
114
|
- !ruby/object:Gem::Version
|
@@ -131,7 +116,6 @@ dependencies:
|
|
131
116
|
- !ruby/object:Gem::Dependency
|
132
117
|
name: bundler
|
133
118
|
requirement: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
119
|
requirements:
|
136
120
|
- - ! '>='
|
137
121
|
- !ruby/object:Gem::Version
|
@@ -139,7 +123,6 @@ dependencies:
|
|
139
123
|
type: :development
|
140
124
|
prerelease: false
|
141
125
|
version_requirements: !ruby/object:Gem::Requirement
|
142
|
-
none: false
|
143
126
|
requirements:
|
144
127
|
- - ! '>='
|
145
128
|
- !ruby/object:Gem::Version
|
@@ -147,23 +130,20 @@ dependencies:
|
|
147
130
|
- !ruby/object:Gem::Dependency
|
148
131
|
name: rake
|
149
132
|
requirement: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
133
|
requirements:
|
152
|
-
- -
|
134
|
+
- - ! '>='
|
153
135
|
- !ruby/object:Gem::Version
|
154
|
-
version: 0
|
136
|
+
version: '0'
|
155
137
|
type: :development
|
156
138
|
prerelease: false
|
157
139
|
version_requirements: !ruby/object:Gem::Requirement
|
158
|
-
none: false
|
159
140
|
requirements:
|
160
|
-
- -
|
141
|
+
- - ! '>='
|
161
142
|
- !ruby/object:Gem::Version
|
162
|
-
version: 0
|
143
|
+
version: '0'
|
163
144
|
- !ruby/object:Gem::Dependency
|
164
145
|
name: rspec
|
165
146
|
requirement: !ruby/object:Gem::Requirement
|
166
|
-
none: false
|
167
147
|
requirements:
|
168
148
|
- - ~>
|
169
149
|
- !ruby/object:Gem::Version
|
@@ -171,7 +151,6 @@ dependencies:
|
|
171
151
|
type: :development
|
172
152
|
prerelease: false
|
173
153
|
version_requirements: !ruby/object:Gem::Requirement
|
174
|
-
none: false
|
175
154
|
requirements:
|
176
155
|
- - ~>
|
177
156
|
- !ruby/object:Gem::Version
|
@@ -179,39 +158,34 @@ dependencies:
|
|
179
158
|
- !ruby/object:Gem::Dependency
|
180
159
|
name: yard
|
181
160
|
requirement: !ruby/object:Gem::Requirement
|
182
|
-
none: false
|
183
161
|
requirements:
|
184
|
-
- -
|
162
|
+
- - ! '>='
|
185
163
|
- !ruby/object:Gem::Version
|
186
|
-
version: 0
|
164
|
+
version: '0'
|
187
165
|
type: :development
|
188
166
|
prerelease: false
|
189
167
|
version_requirements: !ruby/object:Gem::Requirement
|
190
|
-
none: false
|
191
168
|
requirements:
|
192
|
-
- -
|
169
|
+
- - ! '>='
|
193
170
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0
|
171
|
+
version: '0'
|
195
172
|
- !ruby/object:Gem::Dependency
|
196
173
|
name: simplecov
|
197
174
|
requirement: !ruby/object:Gem::Requirement
|
198
|
-
none: false
|
199
175
|
requirements:
|
200
|
-
- -
|
176
|
+
- - ! '>='
|
201
177
|
- !ruby/object:Gem::Version
|
202
|
-
version: 0
|
178
|
+
version: '0'
|
203
179
|
type: :development
|
204
180
|
prerelease: false
|
205
181
|
version_requirements: !ruby/object:Gem::Requirement
|
206
|
-
none: false
|
207
182
|
requirements:
|
208
|
-
- -
|
183
|
+
- - ! '>='
|
209
184
|
- !ruby/object:Gem::Version
|
210
|
-
version: 0
|
185
|
+
version: '0'
|
211
186
|
- !ruby/object:Gem::Dependency
|
212
187
|
name: autotest
|
213
188
|
requirement: !ruby/object:Gem::Requirement
|
214
|
-
none: false
|
215
189
|
requirements:
|
216
190
|
- - ! '>='
|
217
191
|
- !ruby/object:Gem::Version
|
@@ -219,15 +193,13 @@ dependencies:
|
|
219
193
|
type: :development
|
220
194
|
prerelease: false
|
221
195
|
version_requirements: !ruby/object:Gem::Requirement
|
222
|
-
none: false
|
223
196
|
requirements:
|
224
197
|
- - ! '>='
|
225
198
|
- !ruby/object:Gem::Version
|
226
199
|
version: '0'
|
227
200
|
- !ruby/object:Gem::Dependency
|
228
|
-
name:
|
201
|
+
name: pry
|
229
202
|
requirement: !ruby/object:Gem::Requirement
|
230
|
-
none: false
|
231
203
|
requirements:
|
232
204
|
- - ! '>='
|
233
205
|
- !ruby/object:Gem::Version
|
@@ -235,31 +207,27 @@ dependencies:
|
|
235
207
|
type: :development
|
236
208
|
prerelease: false
|
237
209
|
version_requirements: !ruby/object:Gem::Requirement
|
238
|
-
none: false
|
239
210
|
requirements:
|
240
211
|
- - ! '>='
|
241
212
|
- !ruby/object:Gem::Version
|
242
213
|
version: '0'
|
243
214
|
- !ruby/object:Gem::Dependency
|
244
|
-
name:
|
215
|
+
name: pry-doc
|
245
216
|
requirement: !ruby/object:Gem::Requirement
|
246
|
-
none: false
|
247
217
|
requirements:
|
248
|
-
- -
|
218
|
+
- - ! '>='
|
249
219
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
220
|
+
version: '0'
|
251
221
|
type: :development
|
252
222
|
prerelease: false
|
253
223
|
version_requirements: !ruby/object:Gem::Requirement
|
254
|
-
none: false
|
255
224
|
requirements:
|
256
|
-
- -
|
225
|
+
- - ! '>='
|
257
226
|
- !ruby/object:Gem::Version
|
258
|
-
version:
|
227
|
+
version: '0'
|
259
228
|
- !ruby/object:Gem::Dependency
|
260
|
-
name:
|
229
|
+
name: pry-debugger
|
261
230
|
requirement: !ruby/object:Gem::Requirement
|
262
|
-
none: false
|
263
231
|
requirements:
|
264
232
|
- - ! '>='
|
265
233
|
- !ruby/object:Gem::Version
|
@@ -267,11 +235,38 @@ dependencies:
|
|
267
235
|
type: :development
|
268
236
|
prerelease: false
|
269
237
|
version_requirements: !ruby/object:Gem::Requirement
|
270
|
-
none: false
|
271
238
|
requirements:
|
272
239
|
- - ! '>='
|
273
240
|
- !ruby/object:Gem::Version
|
274
241
|
version: '0'
|
242
|
+
- !ruby/object:Gem::Dependency
|
243
|
+
name: ZenTest
|
244
|
+
requirement: !ruby/object:Gem::Requirement
|
245
|
+
requirements:
|
246
|
+
- - ~>
|
247
|
+
- !ruby/object:Gem::Version
|
248
|
+
version: 4.9.0
|
249
|
+
type: :development
|
250
|
+
prerelease: false
|
251
|
+
version_requirements: !ruby/object:Gem::Requirement
|
252
|
+
requirements:
|
253
|
+
- - ~>
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
version: 4.9.0
|
256
|
+
- !ruby/object:Gem::Dependency
|
257
|
+
name: factory_girl
|
258
|
+
requirement: !ruby/object:Gem::Requirement
|
259
|
+
requirements:
|
260
|
+
- - ~>
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: 3.3.0
|
263
|
+
type: :development
|
264
|
+
prerelease: false
|
265
|
+
version_requirements: !ruby/object:Gem::Requirement
|
266
|
+
requirements:
|
267
|
+
- - ~>
|
268
|
+
- !ruby/object:Gem::Version
|
269
|
+
version: 3.3.0
|
275
270
|
description: tengine_core is a framework/engine to support distributed processing
|
276
271
|
email: tengine-info@groovenauts.jp
|
277
272
|
executables:
|
@@ -293,14 +288,23 @@ files:
|
|
293
288
|
- examples/uc08_if_both_a_and_b_occurs.rb
|
294
289
|
- examples/uc10_if_the_event_occurs_at_the_server.rb
|
295
290
|
- examples/uc20_fire_with_properties.rb
|
291
|
+
- examples/uc20_fire_with_properties.rb~
|
296
292
|
- examples/uc21_fire_with_same_key.rb
|
293
|
+
- examples/uc21_fire_with_same_key.rb~
|
297
294
|
- examples/uc22_fire_with_source_name.rb
|
295
|
+
- examples/uc22_fire_with_source_name.rb~
|
298
296
|
- examples/uc23_fire_with_level.rb
|
297
|
+
- examples/uc23_fire_with_level.rb~
|
299
298
|
- examples/uc24_fire_with_level_key.rb
|
299
|
+
- examples/uc24_fire_with_level_key.rb~
|
300
300
|
- examples/uc30_local_variables.rb
|
301
|
+
- examples/uc30_local_variables.rb~
|
301
302
|
- examples/uc31_instance_variables.rb
|
303
|
+
- examples/uc31_instance_variables.rb~
|
302
304
|
- examples/uc32_class_variables.rb
|
305
|
+
- examples/uc32_class_variables.rb~
|
303
306
|
- examples/uc33_statics.rb
|
307
|
+
- examples/uc33_statics.rb~
|
304
308
|
- examples/uc50_commit_event_at_first.rb
|
305
309
|
- examples/uc51_commit_event_at_first_submit.rb
|
306
310
|
- examples/uc52_commit_event_after_all_handler_submit.rb
|
@@ -339,6 +343,7 @@ files:
|
|
339
343
|
- lib/tengine/core/collection_accessible.rb
|
340
344
|
- lib/tengine/core/config/atd.rb
|
341
345
|
- lib/tengine/core/config/core.rb
|
346
|
+
- lib/tengine/core/config/db.rb
|
342
347
|
- lib/tengine/core/config/heartbeat_watcher.rb
|
343
348
|
- lib/tengine/core/config.rb
|
344
349
|
- lib/tengine/core/connection_test/fire_bar_on_foo.rb
|
@@ -381,29 +386,25 @@ files:
|
|
381
386
|
homepage: https://github.com/tengine/tengine/tree/develop/tengine_core
|
382
387
|
licenses:
|
383
388
|
- MPL2.0/LGPLv3
|
389
|
+
metadata: {}
|
384
390
|
post_install_message:
|
385
391
|
rdoc_options: []
|
386
392
|
require_paths:
|
387
393
|
- lib
|
388
394
|
required_ruby_version: !ruby/object:Gem::Requirement
|
389
|
-
none: false
|
390
395
|
requirements:
|
391
396
|
- - ! '>='
|
392
397
|
- !ruby/object:Gem::Version
|
393
398
|
version: '0'
|
394
|
-
segments:
|
395
|
-
- 0
|
396
|
-
hash: -2800458740640956284
|
397
399
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
398
|
-
none: false
|
399
400
|
requirements:
|
400
401
|
- - ! '>='
|
401
402
|
- !ruby/object:Gem::Version
|
402
403
|
version: '0'
|
403
404
|
requirements: []
|
404
405
|
rubyforge_project:
|
405
|
-
rubygems_version:
|
406
|
+
rubygems_version: 2.0.3
|
406
407
|
signing_key:
|
407
|
-
specification_version:
|
408
|
+
specification_version: 4
|
408
409
|
summary: tengine_core is a framework/engine to support distributed processing
|
409
410
|
test_files: []
|