Method: PatronusFati::Connection#start_read_thread
- Defined in:
- lib/patronus_fati/connection.rb
#start_read_thread ⇒ void (protected)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/patronus_fati/connection.rb', line 54 def start_read_thread self.read_thread = Thread.new do begin while (line = socket.readline) read_queue << line end rescue IOError, EOFError => e raise DisconnectError rescue => e PatronusFati.logger.error(format('Error in read thread: %s %s', e.class.to_s, e.)) e.backtrace.each do |l| PatronusFati.logger.error(l) end ensure socket.close if socket && !socket.closed? end end end |