Class: PWork::Async::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/pwork/async/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTask

Returns a new instance of Task.



11
12
13
14
15
# File 'lib/pwork/async/task.rb', line 11

def initialize
  self.id = SecureRandom.uuid
  self.state = :pending
  self.thread_local_storage = []
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



9
10
11
# File 'lib/pwork/async/task.rb', line 9

def block
  @block
end

#callerObject

Returns the value of attribute caller.



10
11
12
# File 'lib/pwork/async/task.rb', line 10

def caller
  @caller
end

#errorObject

Returns the value of attribute error.



8
9
10
# File 'lib/pwork/async/task.rb', line 8

def error
  @error
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/pwork/async/task.rb', line 5

def id
  @id
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/pwork/async/task.rb', line 6

def state
  @state
end

#thread_local_storageObject

Returns the value of attribute thread_local_storage.



7
8
9
# File 'lib/pwork/async/task.rb', line 7

def thread_local_storage
  @thread_local_storage
end