Module: Pione::System::FileCache
- Defined in:
- lib/pione/system/file-cache.rb
Overview
FileCache is a caching system for task workers.
Defined Under Namespace
Classes: FileCacheMethod, SimpleCacheMethod
Class Method Summary collapse
-
.cache_method ⇒ Class
Return file cache class.
-
.cached?(location) ⇒ Boolean
Return true if the location is cached.
-
.clear ⇒ void
Clear cache.
-
.get(location) ⇒ Pathname
Get cached data path from the uri resource.
-
.instance ⇒ CacheMethod
Return the singleton.
-
.put(src, location) ⇒ void
Put the data to the location and caches it.
-
.set_cache_method(klass) ⇒ void
Set a file cache class.
-
.sync(old_location, new_location) ⇒ void
Synchronize cache of old location with new location.
Class Method Details
.cache_method ⇒ Class
Return file cache class.
9 10 11 |
# File 'lib/pione/system/file-cache.rb', line 9 def self.cache_method @klass || SimpleCacheMethod end |
.cached?(location) ⇒ Boolean
Return true if the location is cached.
66 67 68 |
# File 'lib/pione/system/file-cache.rb', line 66 def self.cached?(location) instance.cached?(location) end |
.clear ⇒ void
This method returns an undefined value.
Clear cache.
73 74 75 |
# File 'lib/pione/system/file-cache.rb', line 73 def self.clear instance.clear end |
.get(location) ⇒ Pathname
Get cached data path from the uri resource.
36 37 38 |
# File 'lib/pione/system/file-cache.rb', line 36 def self.get(location) instance.get(location) end |
.instance ⇒ CacheMethod
Return the singleton.
26 27 28 |
# File 'lib/pione/system/file-cache.rb', line 26 def self.instance @instance ||= cache_method.new end |
.put(src, location) ⇒ void
This method returns an undefined value.
Put the data to the location and caches it.
47 48 49 |
# File 'lib/pione/system/file-cache.rb', line 47 def self.put(src, location) instance.put(src, location) end |
.set_cache_method(klass) ⇒ void
This method returns an undefined value.
Set a file cache class.
18 19 20 |
# File 'lib/pione/system/file-cache.rb', line 18 def self.set_cache_method(klass) @klass = klass end |
.sync(old_location, new_location) ⇒ void
This method returns an undefined value.
Synchronize cache of old location with new location.
58 59 60 |
# File 'lib/pione/system/file-cache.rb', line 58 def self.sync(old_location, new_location) instance.sync(old_location, new_location) end |