Commit d6ee5b84 by samrobinson Committed by Oliver Woodman

Group overloaded method together.

PiperOrigin-RevId: 323806853
parent 867d45ca
...@@ -293,6 +293,20 @@ public final class PlayerMessage { ...@@ -293,6 +293,20 @@ public final class PlayerMessage {
} }
/** /**
* Marks the message as processed. Should only be called by a {@link Sender} and may be called
* multiple times.
*
* @param isDelivered Whether the message has been delivered to its target. The message is
* considered as being delivered when this method has been called with {@code isDelivered} set
* to true at least once.
*/
public synchronized void markAsProcessed(boolean isDelivered) {
this.isDelivered |= isDelivered;
isProcessed = true;
notifyAll();
}
/**
* Blocks until after the message has been delivered or the player is no longer able to deliver * Blocks until after the message has been delivered or the player is no longer able to deliver
* the message or the specified waiting time elapses. * the message or the specified waiting time elapses.
* *
...@@ -314,20 +328,6 @@ public final class PlayerMessage { ...@@ -314,20 +328,6 @@ public final class PlayerMessage {
return experimental_blockUntilDelivered(timeoutMs, Clock.DEFAULT); return experimental_blockUntilDelivered(timeoutMs, Clock.DEFAULT);
} }
/**
* Marks the message as processed. Should only be called by a {@link Sender} and may be called
* multiple times.
*
* @param isDelivered Whether the message has been delivered to its target. The message is
* considered as being delivered when this method has been called with {@code isDelivered} set
* to true at least once.
*/
public synchronized void markAsProcessed(boolean isDelivered) {
this.isDelivered |= isDelivered;
isProcessed = true;
notifyAll();
}
@VisibleForTesting() @VisibleForTesting()
/* package */ synchronized boolean experimental_blockUntilDelivered(long timeoutMs, Clock clock) /* package */ synchronized boolean experimental_blockUntilDelivered(long timeoutMs, Clock clock)
throws InterruptedException, TimeoutException { throws InterruptedException, TimeoutException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment