Support for Erlang-style processes.
Send a message to the spawned process
# File lib/em/spawnable.rb, line 31 def notify *x me = self EM.next_tick { # A notification executes in the context of this # SpawnedProcess object. That makes self and notify # work as one would expect. # y = me.call(*x) if y and y.respond_to?(:pull_out_yield_block) a,b = y.pull_out_yield_block set_receiver a self.notify if b end } end
# File lib/em/spawnable.rb, line 53 def set_receiver blk $em______tmpglobal = blk class << self define_method :call, $em______tmpglobal.dup end end