Class: Barbeque::Message::Base
- Inherits:
-
Object
- Object
- Barbeque::Message::Base
- Defined in:
- lib/barbeque/message/base.rb
Overview
A model wrapping Aws::SQS::Types::Message.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
- String
-
Barbeque::JobExecution is associated via ‘message_id`.
-
#receipt_handle ⇒ Object
readonly
- String
-
Used to ack a message.
-
#sent_timestamp ⇒ Object
readonly
- String
-
The time the message was sent to the queue (epoch time in milliseconds).
-
#type ⇒ Object
readonly
- String
-
“JobExecution”, “JobRetry”, etc.
Instance Method Summary collapse
-
#initialize(raw_message, message_body) ⇒ Base
constructor
A new instance of Base.
-
#valid? ⇒ Boolean
To distinguish with ‘Barbeque::Message::InvalidMessage`.
Constructor Details
#initialize(raw_message, message_body) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 |
# File 'lib/barbeque/message/base.rb', line 12 def initialize(, ) assign_body() @id = . @receipt_handle = .receipt_handle @sent_timestamp = .attributes['SentTimestamp'] end |
Instance Attribute Details
#id ⇒ Object (readonly)
- String
-
Barbeque::JobExecution is associated via ‘message_id`
5 6 7 |
# File 'lib/barbeque/message/base.rb', line 5 def id @id end |
#receipt_handle ⇒ Object (readonly)
- String
-
Used to ack a message
6 7 8 |
# File 'lib/barbeque/message/base.rb', line 6 def receipt_handle @receipt_handle end |
#sent_timestamp ⇒ Object (readonly)
- String
-
The time the message was sent to the queue (epoch time in milliseconds)
8 9 10 |
# File 'lib/barbeque/message/base.rb', line 8 def @sent_timestamp end |
#type ⇒ Object (readonly)
- String
-
“JobExecution”, “JobRetry”, etc
7 8 9 |
# File 'lib/barbeque/message/base.rb', line 7 def type @type end |
Instance Method Details
#valid? ⇒ Boolean
To distinguish with ‘Barbeque::Message::InvalidMessage`
20 21 22 |
# File 'lib/barbeque/message/base.rb', line 20 def valid? true end |