Class: EventMachine::SystemCmd

Inherits:
Connection show all
Defined in:
lib/em/processes.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Connection

#signature

Instance Method Summary collapse

Methods inherited from Connection

#associate_callback_target, #close_connection, #close_connection_after_writing, #comm_inactivity_timeout, #comm_inactivity_timeout=, #connection_completed, #detach, #error?, #get_outbound_data_size, #get_peer_cert, #get_peername, #get_pid, #get_sock_opt, #get_sockname, #get_status, new, #notify_readable=, #notify_readable?, #notify_writable=, #notify_writable?, #pause, #paused?, #pending_connect_timeout, #pending_connect_timeout=, #post_init, #proxy_incoming_to, #proxy_target_unbound, #reconnect, #resume, #send_data, #send_datagram, #send_file_data, #set_comm_inactivity_timeout, #set_pending_connect_timeout, #ssl_handshake_completed, #ssl_verify_peer, #start_tls, #stop_proxying, #stream_file_data

Constructor Details

#initialize(cb) ⇒ SystemCmd

Returns a new instance of SystemCmd.



73
74
75
76
# File 'lib/em/processes.rb', line 73

def initialize cb
  @cb = cb
  @output = []
end

Instance Method Details

#receive_data(data) ⇒ Object



77
78
79
# File 'lib/em/processes.rb', line 77

def receive_data data
  @output << data
end

#unbindObject



80
81
82
# File 'lib/em/processes.rb', line 80

def unbind
  @cb.call @output.join(''), get_status if @cb
end