Class: Qs::QueueItem

Inherits:
Object
  • Object
show all
Defined in:
lib/qs/queue_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_redis_key, encoded_payload) ⇒ QueueItem

Returns a new instance of QueueItem.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/qs/queue_item.rb', line 10

def initialize(queue_redis_key, encoded_payload)
  @queue_redis_key = queue_redis_key
  @encoded_payload = encoded_payload
  @started         = false
  @finished        = false

  @message       = nil
  @handler_class = nil
  @exception     = nil
  @time_taken    = nil
end

Instance Attribute Details

#encoded_payloadObject (readonly)

Returns the value of attribute encoded_payload.



5
6
7
# File 'lib/qs/queue_item.rb', line 5

def encoded_payload
  @encoded_payload
end

#exceptionObject

Returns the value of attribute exception.



8
9
10
# File 'lib/qs/queue_item.rb', line 8

def exception
  @exception
end

#finishedObject

Returns the value of attribute finished.



6
7
8
# File 'lib/qs/queue_item.rb', line 6

def finished
  @finished
end

#handler_classObject

Returns the value of attribute handler_class.



7
8
9
# File 'lib/qs/queue_item.rb', line 7

def handler_class
  @handler_class
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/qs/queue_item.rb', line 7

def message
  @message
end

#queue_redis_keyObject (readonly)

Returns the value of attribute queue_redis_key.



5
6
7
# File 'lib/qs/queue_item.rb', line 5

def queue_redis_key
  @queue_redis_key
end

#startedObject

Returns the value of attribute started.



6
7
8
# File 'lib/qs/queue_item.rb', line 6

def started
  @started
end

#time_takenObject

Returns the value of attribute time_taken.



8
9
10
# File 'lib/qs/queue_item.rb', line 8

def time_taken
  @time_taken
end

Instance Method Details

#==(other) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/qs/queue_item.rb', line 22

def ==(other)
  if other.kind_of?(self.class)
    self.queue_redis_key == other.queue_redis_key &&
    self.encoded_payload == other.encoded_payload
  else
    super
  end
end