Class: FocusActor::FutureCell
- Inherits:
-
Object
- Object
- FocusActor::FutureCell
- Defined in:
- lib/focus_actor/future_cell.rb
Instance Method Summary collapse
-
#initialize(queue) ⇒ FutureCell
constructor
A new instance of FutureCell.
- #value ⇒ Object
Constructor Details
#initialize(queue) ⇒ FutureCell
Returns a new instance of FutureCell.
3 4 5 6 |
# File 'lib/focus_actor/future_cell.rb', line 3 def initialize(queue) @queue = queue @value_lock = Mutex.new end |
Instance Method Details
#value ⇒ Object
8 9 10 11 12 |
# File 'lib/focus_actor/future_cell.rb', line 8 def value @value ||= @value_lock.synchronize do @value ||= @queue.pop end end |