Class CachingContext

java.lang.Object
io.rtr.alchemy.caching.CachingContext
All Implemented Interfaces:
Closeable, AutoCloseable

public class CachingContext extends Object implements Closeable
A context object that allows you to interact safely with the cache, preventing multiple calls to invalidate from triggering redundant cache reloads and allowing the user the option to invalidate the cache asynchronously
  • Constructor Details

  • Method Details

    • invalidateAll

      public void invalidateAll(boolean async)
      Forces cache to reload all data from storage
    • invalidate

      public void invalidate(String experimentName, boolean async)
      Forces cache to reload a specific experiment from storage
    • update

      public void update(Experiment experiment)
      Updates the cache with a newly loaded experiment
    • delete

      public void delete(String experimentName)
      Updates the cache with a recently deleted experiment
    • checkIfAnyStale

      public boolean checkIfAnyStale()
      Checks whether any experiments are stale
    • checkIfStale

      public boolean checkIfStale(String experimentName)
      Checks whether a given experiment is stale
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException