Added message notifications.
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
4c1e28b04f
commit
9374c5a681
@ -146,6 +146,7 @@ public final class ReadingRunnable implements Runnable {
|
|||||||
public String getMessage() throws IOException {
|
public String getMessage() throws IOException {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
if (!messages.isEmpty()) {
|
if (!messages.isEmpty()) {
|
||||||
|
notifyMessage(messages.peek());
|
||||||
return messages.poll();
|
return messages.poll();
|
||||||
}
|
}
|
||||||
if (!running) {
|
if (!running) {
|
||||||
@ -168,6 +169,7 @@ public final class ReadingRunnable implements Runnable {
|
|||||||
public String getNextMessage(final long timeout) throws IOException {
|
public String getNextMessage(final long timeout) throws IOException {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
if (!messages.isEmpty()) {
|
if (!messages.isEmpty()) {
|
||||||
|
notifyMessage(messages.peek());
|
||||||
return messages.poll();
|
return messages.poll();
|
||||||
}
|
}
|
||||||
if (!running) {
|
if (!running) {
|
||||||
@ -179,6 +181,7 @@ public final class ReadingRunnable implements Runnable {
|
|||||||
if (messages.isEmpty()) {
|
if (messages.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
notifyMessage(messages.peek());
|
||||||
return messages.poll();
|
return messages.poll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user