Method: RightScale::Windows::PipeServerHandler#notify_readable

Defined in:
lib/chef/windows/pipe_server.rb

#notify_readableObject

Callback from EM to asynchronously read the pipe stream. Note that this callback mechanism is deprecated after EM v0.12.8



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/chef/windows/pipe_server.rb', line 66

def notify_readable
  if @state == RESPONDING_STATE || @pipe.wait(WAIT_SLEEP_DELAY_MSECS)
    if @pipe.pending?
      handle_pending
    else
      handle_non_pending
    end

    # sleep a little to allow asynchronous I/O time to complete and
    # avoid busy looping.
    sleep ASYNC_IO_SLEEP_DELAY_MSECS
  end
rescue Exception => e
  RightScale::Log.error("Failed to send data to Powershell", e, :trace)
  (disconnect rescue nil) if @state != CONNECTING_STATE
end