Skip to content

0.33: Merge pull request #30 from digipost/countdown-targetstate

Compare
Choose a tag to compare
@runeflobakk runeflobakk released this 02 Jan 13:11
· 35 commits to main since this release
1f7a5a7

#30

A TargetState is used to determine is a certain state has been reached yet, commonly by querying TargetState.yet():

final TargetState cancelled;
...
    if (!cancelled.yet()) {
        // do work 
    }

A CountDown is an internally managed TargetState which by itself reaches its target state of "count down reached zero" after an exact amount of queries to CountDown.yet().

The typical use-case for this is testing.