diff options
author | hirocaster <hohtsuka@gmail.com> | 2015-12-14 23:03:34 +0900 |
---|---|---|
committer | hirocaster <hohtsuka@gmail.com> | 2015-12-14 23:03:34 +0900 |
commit | ff847590f30c2657994276d3e38c72ff288dc02e (patch) | |
tree | 67712dcb943ad26b1e62b8e7e9c44f3d527d9a78 /activesupport | |
parent | 0b224ddd552dbe87280dfdd1eb7a8f25d7d4e062 (diff) | |
download | rails-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')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 4 |
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 |