Add a warning about side effect in the javadoc about onItem().consume
package io.smallrye.mutiny.groups;
-import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull;
+import io.smallrye.mutiny.Multi;
+import io.smallrye.mutiny.Uni;
+import io.smallrye.mutiny.infrastructure.Infrastructure;
+import io.smallrye.mutiny.operators.*;
+import io.smallrye.mutiny.subscription.UniEmitter;
+import org.reactivestreams.Publisher;
import java.util.concurrent.CompletionStage;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
-import org.reactivestreams.Publisher;
-
-import io.smallrye.mutiny.Multi;
-import io.smallrye.mutiny.Uni;
-import io.smallrye.mutiny.infrastructure.Infrastructure;
-import io.smallrye.mutiny.operators.UniFlatMapCompletionStageOnItem;
-import io.smallrye.mutiny.operators.UniFlatMapOnItem;
-import io.smallrye.mutiny.operators.UniMapOnResult;
-import io.smallrye.mutiny.operators.UniOnEventConsume;
-import io.smallrye.mutiny.operators.UniProduceMultiOnItem;
-import io.smallrye.mutiny.subscription.UniEmitter;
+import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull;
public class UniOnItem<T> {
@@ -28,8 +23,11 @@ public class UniOnItem<T> {
}
/**
- * Produces a new {@link Uni} invoking the given callback when the {@code item} event is fired. Note that if can
- * be {@code null}.
+ * Produces a new {@link Uni} invoking the given callback when the {@code item} event is fired. Note that the
+ * item can be {@code null}.
+ * <p>
+ * While this method allows implementing side-effects, it is recommended to not do so, and only use this method
+ * to execute side-effect free synchronous logic, like tracing.
*
* @param callback the callback, must not be {@code null}
* @return the new {@link Uni}
