'call another task in middle of code (Java Reactive)

My code something like this:

fun reviewSentiment(
    dbId: Long,
    reply: String? = null,
    addToComments: Boolean = false
): Mono<Void> {
    return db.readById(dbId).flatMap { s ->
        LoggedUser.logged().flatMap { c ->
            if (c.profileId == s.id) {

                //some method call
                db.sentiments.write(s)

                if (addToComments && reply != null) {
                    db.commentWrite(Comment( //////THIS LINE WARNING
                        c.uri(), reply, sentimentId
                    ))
                }
                
            } else Mono.empty()
        }
    }.then()
}

Intellij waringn me at line of db.commentWrite "Value is never used as Publisher" I dont know how to handle that.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source