Class EventMachine::DeferrableChildProcess
In: lib/em/processes.rb
Parent: EventMachine::Connection

EM::DeferrableChildProcess is a sugaring of a common use-case involving EM::popen. Call the open method on EM::DeferrableChildProcess, passing a command-string. open immediately returns an EM::Deferrable object. It also schedules the forking of a child process, which will execute the command passed to open. When the forked child terminates, the Deferrable will be signalled and execute its callbacks, passing the data that the child process wrote to stdout.

Methods

open   receive_data   unbind  

Included Modules

EventMachine::Deferrable

Public Class methods

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.

Public Instance methods

[Validate]