* This is in preparation to a planed refinement.
* The refinment will move the `subscribe()`-call out of the implementation
of the `StorageStrategy`.
throw new RuntimeException(e);
}
})
- .subscribe(chatRoomInfo ->
+ .map(chatRoomInfo ->
{
try
{
ChatRoomInfoTo chatRoomInfoTo = ChatRoomInfoTo.from(chatRoomInfo);
generator.writeObject(chatRoomInfoTo);
+ return chatRoomInfo;
}
catch (IOException e)
{
throw new RuntimeException(e);
}
- });
+ })
+ .subscribe();
}
catch (IOException e)
{
throw new RuntimeException(e);
}
})
- .subscribe(message ->
+ .map(message ->
{
try
{
MessageTo messageTo = MessageTo.from(message);
generator.writeObject(messageTo);
+ return message;
}
catch (IOException e)
{
throw new RuntimeException(e);
}
- });
+ })
+ .subscribe();
}
catch (IOException e)
{
{
chatRoomInfoFlux
.map(ChatRoomTo::from)
- .subscribe(chatroomTo -> chatRoomRepository.save(chatroomTo));
+ .map(chatroomTo -> chatRoomRepository.save(chatroomTo))
+ .subscribe();
}
@Override
{
messageFlux
.map(message -> MessageTo.from(chatRoomId, message))
- .subscribe(messageTo -> messageRepository.save(messageTo));
+ .map(messageTo -> messageRepository.save(messageTo))
+ .subscribe();
}
@Override