Method: Concurrent::Futures::Ref#modify

Defined in:
lib/concurrent/futures.rb

#modify(&block) ⇒ Object



141
142
143
144
145
146
# File 'lib/concurrent/futures.rb', line 141

def modify( &block )
  @lock.synchronize do
    value = @value
    @value = Future.async { block.call value }
  end
end