Kai Moritz [Wed, 28 Dec 2022 16:23:30 +0000 (17:23 +0100)]
refactor: Refined field-names of `Message` and `MessageTo`
- Choosed longer and more descriptive field-names for the domain-class
`Message`.
- Choosed short names for the TO-class `MessageTO`, which is serialized as
JSON.
Kai Moritz [Wed, 21 Dec 2022 17:57:23 +0000 (18:57 +0100)]
feat: implemented a listen-method for the chat-service based on a Flux
- Switched the return-type of `Chatroom.addMessage()` to `Mono<Message>`.
- Added an inner method, that "persists" the message and also returns
`Mono<Message>`.
- `addMessage()` calls `persistMessage()`, peeks into the subscription and
emits the `Message` to an internal `Sink.multy()` of the `Chatroom`.
- `Chatroom.listen()` creates a `Flux` from the internal Sink, so that
multiple subscribers can listen on the sink and all retrieve the current
messages in parallel.