Skip to content

Commit

Permalink
Extract ObjectSleeper.sleep() method to make it reusable (e.g. in m…
Browse files Browse the repository at this point in the history
…etafacture-fix). (#559)
  • Loading branch information
blackwinter committed Nov 6, 2024
1 parent 7b6e932 commit f069a04
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ public long getSleepTime() {
return sleepTime;
}

@Override
public void process(final T obj) {
/**
* Sleeps for the specified amount of time.
*/
public void sleep() {
try {
Thread.sleep(sleepTime);
}
catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new MetafactureException(e.getMessage(), e);
}
}

@Override
public void process(final T obj) {
sleep();
getReceiver().process(obj);
}

Expand Down

0 comments on commit f069a04

Please sign in to comment.