Method: Concurrent::Futures::Ref#modify

Defined in:
lib/concurrent/futures.rb

#modify(&block) ⇒ Object



139
140
141
142
143
144
# File 'lib/concurrent/futures.rb', line 139

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