Parent

EventMachine::SpawnedProcess

Support for Erlang-style processes.

Public Instance Methods

notify(*x) click to toggle source

Send a message to the spawned process

    # File lib/em/spawnable.rb, line 31
31:     def notify *x
32:       me = self
33:       EM.next_tick {
34:         # A notification executes in the context of this
35:         # SpawnedProcess object. That makes self and notify
36:         # work as one would expect.
37:         #
38:         y = me.call(*x)
39:         if y and y.respond_to?(:pull_out_yield_block)
40:           a,b = y.pull_out_yield_block
41:           set_receiver a
42:           self.notify if b
43:         end
44:       }
45:     end
Also aliased as: resume, run
resume(*x) click to toggle source
Alias for: notify
run(*x) click to toggle source
Alias for: notify
set_receiver(blk) click to toggle source
    # File lib/em/spawnable.rb, line 53
53:     def set_receiver blk
54:       $em______tmpglobal = blk
55:       class << self
56:         define_method :call, $em______tmpglobal.dup
57:       end
58:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.