Method: EventMachine::DeferrableChildProcess.open
- Defined in:
- lib/em/processes.rb
.open(cmd) ⇒ Object
Sugars a common use-case involving forked child processes. #open takes a String argument containing an shell command string (including arguments if desired). #open immediately returns an EventMachine::Deferrable object, without blocking.
It also invokes EventMachine#popen to run the passed-in command in a forked child process.
When the forked child terminates, the Deferrable that #open calls its callbacks, passing the data returned from the child process.
54 55 56 |
# File 'lib/em/processes.rb', line 54 def self.open cmd EventMachine.popen( cmd, DeferrableChildProcess ) end |