Class: Mercury::Fake::QueuedMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/mercury/fake/queued_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, msg, tag, headers, is_ackable) ⇒ QueuedMessage

Returns a new instance of QueuedMessage.



10
11
12
13
14
15
# File 'lib/mercury/fake/queued_message.rb', line 10

def initialize(queue, msg, tag, headers, is_ackable)
   = Metadata.new(tag, headers, proc{queue.ack_or_reject_message(self)}, proc{queue.nack(self)})
  @received_msg = ReceivedMessage.new(msg, , nil, work_queue_name: is_ackable ? queue.worker : nil)
  @headers = headers
  @delivered = false
end

Instance Attribute Details

#deliveredObject

Returns the value of attribute delivered.



8
9
10
# File 'lib/mercury/fake/queued_message.rb', line 8

def delivered
  @delivered
end

#headersObject (readonly)

Returns the value of attribute headers.



7
8
9
# File 'lib/mercury/fake/queued_message.rb', line 7

def headers
  @headers
end

#received_msgObject (readonly)

Returns the value of attribute received_msg.



7
8
9
# File 'lib/mercury/fake/queued_message.rb', line 7

def received_msg
  @received_msg
end

#subscriberObject

Returns the value of attribute subscriber.



8
9
10
# File 'lib/mercury/fake/queued_message.rb', line 8

def subscriber
  @subscriber
end