io.numaproj.numaflow.function.ReduceShutdownActor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of numaflow-java Show documentation
Show all versions of numaflow-java Show documentation
SDK to implement Numaflow Source or User Defined Functions or Sinks in Java.
package io.numaproj.numaflow.function;
import akka.actor.AbstractActor;
import akka.actor.AllDeadLetters;
import akka.actor.Props;
import akka.japi.pf.ReceiveBuilder;
import io.grpc.stub.StreamObserver;
import io.numaproj.numaflow.function.v1.Udfunction;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
/**
* Shutdown actor, listens to exceptions and handles shutdown.
*/
@Slf4j
@AllArgsConstructor
class ReduceShutdownActor extends AbstractActor {
private StreamObserver responseObserver;
private final CompletableFuture failureFuture;
public static Props props(
StreamObserver responseObserver,
CompletableFuture failureFuture) {
return Props.create(ReduceShutdownActor.class, responseObserver, failureFuture);
}
@Override
public void preRestart(Throwable reason, Optional