exe/libcache in libcache-0.1.0 vs exe/libcache in libcache-0.2.0
- old
+ new
@@ -1,17 +1,19 @@
#!/usr/bin/env ruby
require "../lib/libcache/cache_builder"
require_relative "../lib/libcache/file_cache"
-cache = CacheBuilder.with(Cache).set_store(ARGV[0]).set_expiry('3s').set_refresh(Proc.new { |key| key + 12 }).build
+cache = CacheBuilder.with(Cache).set_store(ARGV[0]).set_expiry('3s').set_max(500).build
-cache.put(1, 2)
+cache.put("1as", 2)
-2.times do |i|
- puts cache.get(1)
- sleep i
+7.times do |i|
+ puts cache.exists?("1as")
+ sleep i / 2
end
+
+puts "yeet"
at_exit do
cache.invalidateAll
end
\ No newline at end of file