staging/lib/vcap/staging/plugin/rails3/resources/cf-rails-console/lib/live_console.rb
# LiveConsole#start_blocking executes a loop to listen for, accept,
# and provide an IRB console to new connections.
# This is a blocking call and the only way to stop it is to kill the process
LiveConsole#start_blocking executes a loop to listen for, accept,
and provide an IRB console to new connections.
This is a blocking call and the only way to stop it is to kill the process
LiveConsole#start_blocking executes a loop to listen for accept and provide an IRB console to new connections . This is a blocking call and the only way to stop it is to kill the process
def start_blocking
    loop {
      conn = io.get_connection
      if conn.start
        pid = fork {
          begin
            start_irb = true
            if authenticate && !conn.authenticate
              conn.stop
              start_irb = false
            end
            if start_irb
              irb_io = GenericIOMethod.new conn.raw_input, conn.raw_output, readline
              begin
                IRB.start_with_io(irb_io, bind)
              rescue Errno::EPIPE => e
                conn.stop
              end
            end
          rescue Exception => e
            puts "Error during connection: #{e.message}"
            conn.stop
          end
        }
        Process.detach(pid)
      end
    }
  end
def start_blocking loop { conn = io . get_connection if conn . start pid = fork { begin start_irb = true if authenticate && ! conn . authenticate conn . stop start_irb = false end if start_irb irb_io = GenericIOMethod . new conn . raw_input , conn . raw_output , readline begin IRB . start_with_io ( irb_io , bind ) rescue Errno :: EPIPE => e conn . stop end end rescue Exception => e puts "Error during connection: #{e.message}" conn . stop end } Process . detach ( pid ) end } end
LiveConsole#start_blocking executes a loop to listen for, accept,
and provide an IRB console to new connections.
LiveConsole#start_blocking executes a loop to listen for accept and provide an IRB console to new connections .
#This will block until a connection is made or a failure occurs #fork a new process for the session to redirect stdout/stderr