From: Laza Date: 2006-07-11T10:35:13+09:00 Subject: Re: While loops I assume you are talking about a Rails app. index() should NOT run forever like that. It should generate the page and return. If you want to keep updating someting, "pull" information from the browser using JavaScript (make the while loop in JavaScript). Erich Lin wrote: > If I have this snippet of code for the main page that loads: > > def index > while 1 > logger.info("hi") > end > end > > Then, I close the browser that opened that page, I notice that the > logger continues to print "hi" to the file (using tail -f). Is there a > way to stop the server from running such actions when the browser is > closed? (The logger.info was just an example. It could be anything > else) > > Thanks