Class: RedisClient::Cluster::ConcurrentWorker::Group::Task
- Inherits:
-
Struct
- Object
- Struct
- RedisClient::Cluster::ConcurrentWorker::Group::Task
- Defined in:
- lib/redis_client/cluster/concurrent_worker.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#block ⇒ Object
Returns the value of attribute block.
-
#id ⇒ Object
Returns the value of attribute id.
-
#kwargs ⇒ Object
Returns the value of attribute kwargs.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def args @args end |
#block ⇒ Object
Returns the value of attribute block
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def block @block end |
#id ⇒ Object
Returns the value of attribute id
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def id @id end |
#kwargs ⇒ Object
Returns the value of attribute kwargs
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def kwargs @kwargs end |
#queue ⇒ Object
Returns the value of attribute queue
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def queue @queue end |
#result ⇒ Object
Returns the value of attribute result
13 14 15 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 13 def result @result end |
Instance Method Details
#done ⇒ Object
26 27 28 29 30 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 26 def done queue&.push(self) rescue ClosedQueueError # something was wrong end |
#exec ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/redis_client/cluster/concurrent_worker.rb', line 18 def exec self[:result] = block&.call(*args, **kwargs) rescue StandardError => e self[:result] = e ensure done end |