projects
/
demos
/
kafka
/
chat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5da0c6
)
refactor: Streamlined API of `Chatroom` - all return-types are reactive
author
Kai Moritz
<kai@juplo.de>
Wed, 28 Dec 2022 16:38:00 +0000
(17:38 +0100)
committer
Kai Moritz
<kai@juplo.de>
Sun, 15 Jan 2023 18:35:59 +0000
(19:35 +0100)
src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java
patch
|
blob
|
history
diff --git
a/src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java
b/src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java
index
115dcd6
..
e1638aa
100644
(file)
--- a/
src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java
+++ b/
src/main/java/de/juplo/kafka/chat/backend/domain/Chatroom.java
@@
-10,7
+10,6
@@
import reactor.core.publisher.Sinks;
import java.time.LocalDateTime;
import java.util.*;
-import java.util.stream.Stream;
@RequiredArgsConstructor
@@
-72,16
+71,16
@@
public class Chatroom
return sink.asFlux();
}
- public
Stream
<Message> getMessages(long first, long last)
+ public
Flux
<Message> getMessages(long first, long last)
{
- return messages
+ return
Flux.fromStream(
messages
.values()
.stream()
.filter(message ->
{
long serial = message.getSerialNumber();
return serial >= first && serial <= last;
- });
+ })
)
;
}