Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove runOnIdleState functionality #214

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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