aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache.rb
diff options
context:
space:
mode:
authorhirocaster <hohtsuka@gmail.com>2015-12-14 23:03:34 +0900
committerhirocaster <hohtsuka@gmail.com>2015-12-14 23:03:34 +0900
commitff847590f30c2657994276d3e38c72ff288dc02e (patch)
tree67712dcb943ad26b1e62b8e7e9c44f3d527d9a78 /activesupport/lib/active_support/cache.rb
parent0b224ddd552dbe87280dfdd1eb7a8f25d7d4e062 (diff)
downloadrails-ff847590f30c2657994276d3e38c72ff288dc02e.tar.gz
rails-ff847590f30c2657994276d3e38c72ff288dc02e.tar.bz2
rails-ff847590f30c2657994276d3e38c72ff288dc02e.zip
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.
Diffstat (limited to 'activesupport/lib/active_support/cache.rb')
-rw-r--r--activesupport/lib/active_support/cache.rb4
1 files changed, 2 insertions, 2 deletions
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