lib/rainbows/revactor.rb in rainbows-0.9.0 vs lib/rainbows/revactor.rb in rainbows-0.90.0

- old
+ new

@@ -66,11 +66,11 @@ out = [ alive ? CONN_ALIVE : CONN_CLOSE ] if hp.headers? HttpResponse.write(client, response, out) end while alive and hp.reset.nil? and env.clear rescue ::Revactor::TCP::ReadError rescue => e - handle_error(client, e) + Error.write(client.instance_eval { @_io }, e) ensure client.close end # runs inside each forked worker, this sits around and waits @@ -117,20 +117,9 @@ end end Actor.sleep 1 while G.tick || nr > 0 rescue Errno::EMFILE => e - end - - # if we get any error, try to write something back to the client - # assuming we haven't closed the socket, but don't get hung up - # if the socket is already closed or broken. We'll always ensure - # the socket is closed at the end of this function - def handle_error(client, e) - # this is Revactor implementation dependent - msg = Error.response(e) and - client.instance_eval { @_io.write_nonblock(msg) } - rescue end def revactorize_listeners LISTENERS.map do |s| case s