Class: EventQ::QueueMessage

Inherits:
Object
  • Object
show all
Extended by:
ClassKit
Defined in:
lib/eventq_base/queue_message.rb

Instance Method Summary collapse

Constructor Details

#initializeQueueMessage

Returns a new instance of QueueMessage.



14
15
16
17
18
19
# File 'lib/eventq_base/queue_message.rb', line 14

def initialize
  @retry_attempts = 0
  @created = Time.now.to_f
  @id = SecureRandom.uuid
  @context = {}
end

Instance Method Details

#sign(provider) ⇒ Object

Creates a signature for the message

Parameters:



25
26
27
28
29
# File 'lib/eventq_base/queue_message.rb', line 25

def sign(provider)
  return unless EventQ::Configuration.signature_secret

  self.signature = provider.write(message: self, secret: EventQ::Configuration.signature_secret)
end