Class: Aws::EventStream::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-eventstream/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Message

Returns a new instance of Message.



7
8
9
10
# File 'lib/aws-eventstream/message.rb', line 7

def initialize(options)
  @headers = options[:headers] || {}
  @payload = options[:payload] || StringIO.new
end

Instance Attribute Details

#headersHash (readonly)

Returns headers of a message.

Returns:

  • (Hash)

    headers of a message



13
14
15
# File 'lib/aws-eventstream/message.rb', line 13

def headers
  @headers
end

#payloadIO (readonly)

Returns payload of a message, size not exceed 16MB. StringIO is returned for <= 1MB payload Tempfile is returned for > 1MB payload.

Returns:

  • (IO)

    payload of a message, size not exceed 16MB. StringIO is returned for <= 1MB payload Tempfile is returned for > 1MB payload



18
19
20
# File 'lib/aws-eventstream/message.rb', line 18

def payload
  @payload
end