Skip to content

Commit c20520b

Browse files
committed
TODOs and comments update
1 parent 2b86bc2 commit c20520b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/concurrent/actress.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def initialize(core)
9090
@core = Type! core, Core
9191
end
9292

93-
9493
def tell(message)
9594
message message, nil
9695
end
@@ -153,7 +152,7 @@ class Core
153152
def initialize(parent, name, actress_class, *args, &block)
154153
@mailbox = Array.new
155154
@one_by_one = OneByOne.new
156-
@executor = Concurrent.configuration.global_task_pool # TODO configurable
155+
@executor = Concurrent.configuration.global_task_pool # TODO make configurable
157156
@parent_core = (Type! parent, Reference, NilClass) && parent.send(:core)
158157
@name = (Type! name, String, Symbol).to_s
159158
@children = []
@@ -222,7 +221,9 @@ def terminate!
222221
end
223222

224223
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
226227
end
227228

228229
private
@@ -298,6 +299,7 @@ def on_envelope(envelope)
298299
@envelope = nil
299300
end
300301

302+
# TODO add basic supervision
301303
def spawn(actress_class, name, *args, &block)
302304
Actress.spawn(actress_class, name, *args, &block)
303305
end
@@ -328,7 +330,7 @@ def on_message(message)
328330
when :spawn
329331
spawn *message[1..2], *message[3], &message[4]
330332
else
331-
#ignore
333+
# ignore
332334
end
333335
end
334336
end

0 commit comments

Comments
 (0)