All Downloads are FREE. Search and download functionalities are using the official Maven repository.

_08_misc._02_Logging Maven / Gradle / Ivy

There is a newer version: 2.7.0
Show newest version
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.smallrye.reactive:mutiny:2.7.0-RC4
package _08_misc;

import io.smallrye.mutiny.Multi;

public class _02_Logging {

    public static void main(String[] args) {
        System.out.println("⚡️ Logging");

        Multi multi = Multi.createFrom().range(1, 3)
                .log("source")
                .onItem().transform(i -> ">>> " + i)
                .log("transformed");

        System.out.println();
        System.out.println("🚀 First subscriber");
        multi.subscribe().with(System.out::println);

        System.out.println();
        System.out.println("🚀 Second subscriber");
        multi.subscribe().with(System.out::println);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy