Class for returning a different value every so often I have a class that I'm trying to determine a good name for. I don't know if this concept comes up a lot in programming or not, but I'm wondering if I can get some suggestions for a good name for the class.
Basically, this is how the class functions:

The first time its Get() method is called, it returns value A.
Every subsequent time, it returns value B.
If enough time has passed (provided), return value A one time, then revert back to sending 'B'. Repeat ad finitum.

Is there any name for something that functions like this? It's somewhat like memoization, and kind of like caching, but not quite.
The application of this construct is so described: Every so often I want a method to load complex data from Active Directory to load into our database before returning the results from the table. This ensures that we have recent data in our database. However, the time to execute this is high, and 99% of the time nothing has changed. So I want to limit the checking for changes to long timespans in my web app. So, using this construct I can say &quot;only do the long version every X hours, and once it's been done, don't do it again for X more hours.&quot;
Implementation
The ICurrentDateTimeProvider simply has a Now property so it can be faked for unit tests.
public interface ICurrentDateTimeProvider
{
    DateTime Now { get; }
}

public class CurrentDateTimeProvider : ICurrentDateTimeProvider
{
    public DateTime Now { get { return DateTime.Now; } }
}

public class ReturnDifferentValueEverySoOften&lt;T&gt;
{
    public ReturnDifferentValueEverySoOften(T firstAndSometimes, T most, TimeSpan flipTime = default(TimeSpan), ICurrentDateTimeProvider provider = null)
    {
        FirstAndSometimes = firstAndSometimes;
        MostOfTheTime = most;
        if (flipTime == default(TimeSpan))
            flipTime = TimeSpan.FromHours(6);
        FlipTime = flipTime;
        if (provider == null)
            provider = new CurrentDateTimeProvider();
        DateTimeProvider = provider;
    }

    public void SetTimeProvider(ICurrentDateTimeProvider provider)
    {
        DateTimeProvider = provider;
    }

    public T FirstAndSometimes;
    public T MostOfTheTime;

    ICurrentDateTimeProvider DateTimeProvider { get; set; }
    TimeSpan FlipTime;
    DateTime LastFlip { get; set; }
    DateTime NextFlip { get { return LastFlip.Add(FlipTime); } }
    bool ever = false;

    public T Get()
    {
        var now = DateTimeProvider.Now;
        if (!ever)
        {
            ever = true;
            LastFlip = now;
            return FirstAndSometimes;
        }
        if (NextFlip &lt; now)
        {
            LastFlip = now.Add(FlipTime);
            return FirstAndSometimes;
        }
        return MostOfTheTime;
    }
}

Unit Test
Below is a unit test I wrote to ensure that it functions properly:
[Fact]
public void CanFlipBetweenValues()
{
    var timeToWait = TimeSpan.FromMilliseconds(10);

    var currentTime = DateTime.Now;
    var timeProvider = new Mock&lt;ICurrentDateTimeProvider&gt;();
    timeProvider.SetupGet(x =&gt; x.Now).Returns(currentTime);
    var cacher = new ReturnDifferentValueEverySoOften&lt;bool&gt;(false, true, timeToWait);
    cacher.SetTimeProvider(timeProvider.Object);

    Assert.False(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());

    //add some arbitrary time &gt; timeToWait
    var newTime = currentTime.Add(timeToWait).Add(new TimeSpan(0, 0, 1));
    var newTimeProvider = new Mock&lt;ICurrentDateTimeProvider&gt;();
    newTimeProvider.SetupGet(x =&gt; x.Now).Returns(newTime);
    cacher.SetTimeProvider(newTimeProvider.Object);

    Assert.False(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());
    Assert.True(cacher.Get());
}

Again, I'm mostly looking to see if there exists a better name for something like this, but I'm open to other code review suggestions as well.
I might be completely off with this, but I'll try to propose an alternative design for your problem.

It seems to me that you have two independent tasks in your application:


Fetching the data from the DB (user triggered?, frequent)
Updating the DB from the AD periodically (time consuming)


Define a flag in your application, say, UpdateInProgress. Update task would set it to true before running and reset it after it's done. Every Fetch request that comes while an update is in progress would be queued and executed after the update has completed.