sinatra/sinatra — pull request #535 by yeban (2012-06-24 07:50:06+00:00)
Title: add closed? method on Stream object to inspect the object's open/close state

So I have a list of streaming connections accumulated in a `connections` variable.

From the example on http://www.sinatrarb.com/intro#Streaming%20Responses

```ruby
get '/' do
# keep stream open
stream(:keep_open) { |out| connections << out }
end
```

Over time the list of connections can get huge, and I would like to trim the dead ones:
```ruby
connections.select(&:closed?).each(&:close)
```

Inspecting `@closed` on a stream object doesn't seem like the best way to go about it.