
network.oxalis.ng.commons.tracing.SpanManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oxalis-ng-commons Show documentation
Show all versions of oxalis-ng-commons Show documentation
Holds the stuff which is common for both inbound and outbound messages and should be shared between them.
package network.oxalis.ng.commons.tracing;
import io.opentelemetry.api.trace.Span;
import network.oxalis.ng.commons.util.ClosableSpan;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
public interface SpanManager {
T runWithinSpan(String spanName, Function function);
default T runWithinSpan(String spanName, Supplier function) {
return runWithinSpan(spanName, span -> {
return function.get();
});
}
default void runWithinSpan(String spanName, Consumer function) {
runWithinSpan(spanName, span -> {
function.accept(span);
return null;
});
}
ClosableSpan startClosableSpan(String spanName);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy