Class: Qs::RedisItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_redis_key, serialized_payload) ⇒ RedisItem

Returns a new instance of RedisItem.



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

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

  @job           = nil
  @handler_class = nil
  @exception     = nil
  @time_taken    = nil
end

Instance Attribute Details

#exceptionObject

Returns the value of attribute exception.



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

def exception
  @exception
end

#finishedObject

Returns the value of attribute finished.



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

def finished
  @finished
end

#handler_classObject

Returns the value of attribute handler_class.



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

def handler_class
  @handler_class
end

#jobObject

Returns the value of attribute job.



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

def job
  @job
end

#queue_redis_keyObject (readonly)

Returns the value of attribute queue_redis_key.



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

def queue_redis_key
  @queue_redis_key
end

#serialized_payloadObject (readonly)

Returns the value of attribute serialized_payload.



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

def serialized_payload
  @serialized_payload
end

#startedObject

Returns the value of attribute started.



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

def started
  @started
end

#time_takenObject

Returns the value of attribute time_taken.



8
9
10
# File 'lib/qs/redis_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/redis_item.rb', line 22

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