class Aws::AsyncClientStubs::StubStream

Attributes

send_events[RW]
state[R]

Public Class Methods

new() click to toggle source
# File lib/aws-sdk-core/async_client_stubs.rb, line 55
def initialize
  @state = :open
end

Public Instance Methods

close() click to toggle source
# File lib/aws-sdk-core/async_client_stubs.rb, line 77
def close
  @state = :closed
end
closed?() click to toggle source
# File lib/aws-sdk-core/async_client_stubs.rb, line 73
def closed?
  @state == :closed
end
data(bytes, options = {}) click to toggle source
# File lib/aws-sdk-core/async_client_stubs.rb, line 63
def data(bytes, options = {})
  if options[:end_stream]
    @state = :closed
  else
    decoder = Aws::EventStream::Decoder.new
    event = decoder.decode_chunk(bytes).first
    @send_events << decoder.decode_chunk(event.payload.read).first
  end
end