@Test public void testInvalidateAsync() { context.invalidate("foo", true); verify(executorService).execute(any(Runnable.class)); }
public void invalidate(final String experimentName, boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }); } else { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }
CachingContext implements Closeable { public void invalidate(final String experimentName, boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }); } else { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } } }
CachingContext implements Closeable { public void invalidate(final String experimentName, boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }); } else { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } } CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory,
                          ExecutorService executorService);  CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory); }
CachingContext implements Closeable { public void invalidate(final String experimentName, boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }); } else { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } } CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory,
                          ExecutorService executorService);  CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory); void invalidateAll(boolean async); void invalidate(final String experimentName, boolean async); void update(Experiment experiment); void delete(String experimentName); boolean checkIfAnyStale(); boolean checkIfStale(String experimentName); @Override void close(); }
CachingContext implements Closeable { public void invalidate(final String experimentName, boolean async) { if (async) { executorService.execute(new Runnable() { @Override public void run() { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } }); } else { safeInvalidate(experimentName, builderFactory.createBuilder(experimentName)); } } CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory,
                          ExecutorService executorService);  CachingContext(ExperimentsCache cache,
                          Experiment.BuilderFactory builderFactory); void invalidateAll(boolean async); void invalidate(final String experimentName, boolean async); void update(Experiment experiment); void delete(String experimentName); boolean checkIfAnyStale(); boolean checkIfStale(String experimentName); @Override void close();  }