tribe 0.0.8 → 0.0.9
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/README.md +4 -0
- data/lib/tribe/actable.rb +1 -6
- data/lib/tribe/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -6,6 +6,8 @@ Tribe focuses on high performance, low latency, an easy to use API, and flexibil
|
|
6
6
|
It is built on top of the [Workers] (https://github.com/chadrem/workers "Workers") gem, which allows it to support many actors (millions should be possible).
|
7
7
|
Actors can use a shared thread pool (default) or dedicted threads.
|
8
8
|
|
9
|
+
Event-driven servers can be built using [Tribe EM] (https://github.com/chadrem/tribe_em "Tribe EM").
|
10
|
+
|
9
11
|
## Installation
|
10
12
|
|
11
13
|
Add this line to your application's Gemfile:
|
@@ -35,10 +37,12 @@ Or install it yourself as:
|
|
35
37
|
|
36
38
|
def exception_handler(e)
|
37
39
|
puts concat_e("MyActor (#{identifier}) died.", e)
|
40
|
+
super
|
38
41
|
end
|
39
42
|
|
40
43
|
def shutdown_handler(event)
|
41
44
|
puts "MyActor (#{identifier}) is shutting down. Put cleanup code here."
|
45
|
+
super
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
data/lib/tribe/actable.rb
CHANGED
@@ -52,6 +52,7 @@ module Tribe
|
|
52
52
|
|
53
53
|
rescue Exception => e
|
54
54
|
@alive = false
|
55
|
+
@pool.shutdown if @dedicated
|
55
56
|
exception_handler(e)
|
56
57
|
ensure
|
57
58
|
@mailbox.release do
|
@@ -65,16 +66,10 @@ module Tribe
|
|
65
66
|
send("on_#{event.command}", event)
|
66
67
|
end
|
67
68
|
|
68
|
-
def on_test(event)
|
69
|
-
puts "Actor (#{identifier}) processing event (#{event.inspect}) using thread (#{Thread.current.object_id})."
|
70
|
-
end
|
71
|
-
|
72
69
|
def exception_handler(e)
|
73
|
-
puts concat_e("Actor (#{identifier}) died.", e)
|
74
70
|
end
|
75
71
|
|
76
72
|
def shutdown_handler(event)
|
77
|
-
puts "Actor (#{identifier}) is shutting down."
|
78
73
|
end
|
79
74
|
end
|
80
75
|
end
|
data/lib/tribe/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tribe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: workers
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 1.8.
|
71
|
+
rubygems_version: 1.8.25
|
72
72
|
signing_key:
|
73
73
|
specification_version: 3
|
74
74
|
summary: Actors are lightweight concurrent objects that use asynchronous message passing
|