@@ -90,7 +90,6 @@ def initialize(core)
90
90
@core = Type! core , Core
91
91
end
92
92
93
-
94
93
def tell ( message )
95
94
message message , nil
96
95
end
@@ -153,7 +152,7 @@ class Core
153
152
def initialize ( parent , name , actress_class , *args , &block )
154
153
@mailbox = Array . new
155
154
@one_by_one = OneByOne . new
156
- @executor = Concurrent . configuration . global_task_pool # TODO configurable
155
+ @executor = Concurrent . configuration . global_task_pool # TODO make configurable
157
156
@parent_core = ( Type! parent , Reference , NilClass ) && parent . send ( :core )
158
157
@name = ( Type! name , String , Symbol ) . to_s
159
158
@children = [ ]
@@ -222,7 +221,9 @@ def terminate!
222
221
end
223
222
224
223
def guard!
225
- raise 'can be called only inside this actor' unless Actress . current == reference
224
+ unless Actress . current == reference
225
+ raise "can be called only inside actor #{ reference } but was #{ Actress . current } "
226
+ end
226
227
end
227
228
228
229
private
@@ -298,6 +299,7 @@ def on_envelope(envelope)
298
299
@envelope = nil
299
300
end
300
301
302
+ # TODO add basic supervision
301
303
def spawn ( actress_class , name , *args , &block )
302
304
Actress . spawn ( actress_class , name , *args , &block )
303
305
end
@@ -328,7 +330,7 @@ def on_message(message)
328
330
when :spawn
329
331
spawn *message [ 1 ..2 ] , *message [ 3 ] , &message [ 4 ]
330
332
else
331
- #ignore
333
+ # ignore
332
334
end
333
335
end
334
336
end
0 commit comments