Slide 78
Slide 78 text
method_missing
class ActorsOffice
def initialize(actor)
@queue = Queue.new
@thread = Thread.new(actor) do
catch(actor) do
while true
msg, arg, blk = @queue.pop
actor.__send__(msg, *arg, &blk)
end
end
end
end
def __thread__; @thread; end
def method_missing(m, *a, &b)
@queue.push([m, a, b])
end
end