Class: Appsignal::StreamWrapper
- Defined in:
- lib/appsignal/rack/streaming_listener.rb
Instance Method Summary collapse
- #close ⇒ Object
- #each ⇒ Object
-
#initialize(stream, transaction) ⇒ StreamWrapper
constructor
A new instance of StreamWrapper.
Constructor Details
#initialize(stream, transaction) ⇒ StreamWrapper
Returns a new instance of StreamWrapper.
52 53 54 55 |
# File 'lib/appsignal/rack/streaming_listener.rb', line 52 def initialize(stream, transaction) @stream = stream @transaction = transaction end |
Instance Method Details
#close ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/appsignal/rack/streaming_listener.rb', line 64 def close @stream.close if @stream.respond_to?(:close) rescue Exception => e @transaction.set_error(e) raise e ensure Appsignal::Transaction.complete_current! end |
#each ⇒ Object
57 58 59 60 61 62 |
# File 'lib/appsignal/rack/streaming_listener.rb', line 57 def each @stream.each { |c| yield(c) } rescue Exception => e @transaction.set_error(e) raise e end |