From b6ce2f97ca05efc734e47d22e34467a45a8d45eb Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 7 Sep 2024 14:46:38 +0200 Subject: [PATCH] fix example source --- .../m724/chatapi/example/ExampleSource.groovy | 8 +++---- .../source/impl/BlockingQueueConsumer.java | 22 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/groovy/eu/m724/chatapi/example/ExampleSource.groovy b/src/main/groovy/eu/m724/chatapi/example/ExampleSource.groovy index 1804c76..104ec68 100644 --- a/src/main/groovy/eu/m724/chatapi/example/ExampleSource.groovy +++ b/src/main/groovy/eu/m724/chatapi/example/ExampleSource.groovy @@ -40,7 +40,7 @@ class ExampleSource implements ChatSource { String response = rollResponse(chat) String[] parts = response.split(" ") - ChatMessage message = new ChatMessage(true); + ChatMessage message = new ChatMessage(true) CompletableFuture.supplyAsync { for (int i=0; i type of consumer (usually {@link eu.m724.chatapi.chat.ChatEvent} + */ +@Deprecated public class BlockingQueueConsumer { public final LinkedBlockingQueue queue = new LinkedBlockingQueue<>(); - public final Consumer consumer = new Consumer<>() { - @Override - public void accept(T t) { - try { - queue.put(t); - } catch (InterruptedException e) { - // again I don't know how that is relevant - throw new RuntimeException(e); - } + public final Consumer consumer = t -> { + try { + queue.put(t); + } catch (InterruptedException e) { + // again I don't know how that is relevant + throw new RuntimeException(e); } }; }