Skip to content

Commit

Permalink
refactor: remove runOnIdleState
Browse files Browse the repository at this point in the history
Run on idle state is a feature that we don't want to support at this time. It's best to keep the public interface as minimal as possible before the release. If it turns out users wish to use a functionality like these we can always re-add it later.
  • Loading branch information
remcowesterhoud committed Feb 25, 2022
1 parent fae0ab9 commit 93d379f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ public interface InMemoryEngine {
*/
void increaseTime(Duration timeToAdd);

/**
* Runs the given function once the engine has reached an idle state.
*
* <p>For more info on the idle state refer to {@link IdleStateMonitor}
*
* @param callback the function that should be executed once an idle state has been reached
*/
void runOnIdleState(Runnable callback);

/**
* Waits for the engine to reach an idle state.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,11 @@ public void increaseTime(final Duration timeToAdd) {
clock.addTime(timeToAdd);
}

@Override
public void runOnIdleState(final Runnable callback) {
idleStateMonitor.addCallback(callback);
}

@Override
public void waitForIdleState() {
final CompletableFuture<Void> idleState = new CompletableFuture<>();

runOnIdleState(() -> idleState.complete(null));
idleStateMonitor.addCallback(() -> idleState.complete(null));

idleState.join();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public void increaseTime(final Duration timeToAdd) {
closeChannel(channel);
}

@Override
public void runOnIdleState(final Runnable callback) {
// TODO remove this from interface?
}

@Override
public void waitForIdleState() {
final ManagedChannel channel = getChannel();
Expand Down

0 comments on commit 93d379f

Please sign in to comment.