001package com.avaje.ebean.backgroundexecutor;
002
003import com.avaje.ebean.BackgroundExecutor;
004
005import java.util.concurrent.TimeUnit;
006
007/**
008 * Implementation that immediately executes.
009 * <p>
010 * In the case of running tests usually you want the background task
011 * to bulkUpdate immediately or not at all.
012 */
013public class ImmediateBackgroundExecutor implements BackgroundExecutor {
014
015  @Override
016  public void execute(Runnable r) {
017    r.run();
018  }
019
020  @Override
021  public void executePeriodically(Runnable r, long delay, TimeUnit unit) {
022    r.run();
023  }
024
025}