From ff847590f30c2657994276d3e38c72ff288dc02e Mon Sep 17 00:00:00 2001 From: hirocaster Date: Mon, 14 Dec 2015 23:03:34 +0900 Subject: Change output timming of sample code - Expect returns "new value 1" but, retuns nil, because output at thread is not finished. Move val_1 output to finished thread. --- activesupport/lib/active_support/cache.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 5011014e96..9a4633c692 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -255,10 +255,10 @@ module ActiveSupport # end # end # - # # val_1 => "new value 1" - # # val_2 => "original value" # # sleep 10 # First thread extend the life of cache by another 10 seconds # # cache.fetch('foo') => "new value 1" + # # val_1 => "new value 1" + # # val_2 => "original value" # # Other options will be handled by the specific cache store implementation. # Internally, #fetch calls #read_entry, and calls #write_entry on a cache -- cgit v1.2.3