Package cern.nxcals.api.ingestion
Interface Publisher<V>
-
- Type Parameters:
V- Type of value to be published. in a form ofResult.
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
public interface Publisher<V> extends java.io.CloseableNXCALS Ingestion API main interface. It defines methods to send data to the underlying system returning confirmation
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPublisher.Constants
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Resultpublish(V value)Publishes synchronously the given value to the NXCALS system.default java.util.concurrent.CompletableFuture<Result>publishAsync(V value)Publishes asynchronously the given value to the NXCALS system.java.util.concurrent.CompletableFuture<Result>publishAsync(V value, java.util.concurrent.Executor executor)Publishes asynchronously the given value to the NXCALS system.
-
-
-
Method Detail
-
publish
default Result publish(V value)
Publishes synchronously the given value to the NXCALS system. The invocation is performed using the caller thread.- Parameters:
value- the value to be published- Returns:
- result of the publication
-
publishAsync
default java.util.concurrent.CompletableFuture<Result> publishAsync(V value)
Publishes asynchronously the given value to the NXCALS system. The invocation is performed using theForkJoinPool.commonPool()(unless it does not support a parallelism level of at least two, in which case, a new Thread is created to run each task).- Parameters:
value- the value to be published- Returns:
- result of the publication
-
publishAsync
java.util.concurrent.CompletableFuture<Result> publishAsync(V value, java.util.concurrent.Executor executor)
Publishes asynchronously the given value to the NXCALS system. The invocation is performed using the provided executor.- Parameters:
value- the value to be publishedexecutor- the executor to perform the publication within.- Returns:
- result of the publication
-
-