class EventMachine::DeferrableChildProcess
wrote to stdout.
and execute its callbacks, passing the data that the child process
When the forked child terminates, the Deferrable will be signalled
will execute the command passed to #open.
object. It also schedules the forking of a child process, which
a command-string. #open immediately returns an EM::Deferrable
Call the #open method on EM::DeferrableChildProcess, passing
involving EM::popen.
EM::DeferrableChildProcess is a sugaring of a common use-case
def self.open cmd
from the child process.
#open calls its callbacks, passing the data returned
When the forked child terminates, the Deferrable that
command in a forked child process.
It also invokes EventMachine#popen to run the passed-in
returns an EventMachine::Deferrable object, without blocking.
string (including arguments if desired). #open immediately
#open takes a String argument containing an shell command
Sugars a common use-case involving forked child processes.
def self.open cmd EventMachine.popen( cmd, DeferrableChildProcess ) end
def initialize
- Private: -
def initialize super @data = [] end
def receive_data data
- Private: -
def receive_data data @data << data end
def unbind
- Private: -
def unbind succeed( @data.join ) end