ActorSinkWithAckExample Ack message (#30127)

Using the example does not work in Java, because it seems that `Sink` compares by equality, no by class.
This commit is contained in:
Jorge Gomez 2021-03-31 04:14:12 -03:00 committed by GitHub
parent 4ff77b813e
commit 914a94e405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,9 @@ public class ActorSinkWithAckExample {
// #actor-sink-ref-with-backpressure
class Ack {}
enum Ack {
INSTANCE;
}
interface Protocol {}
@ -58,7 +60,6 @@ public class ActorSinkWithAckExample {
final ActorRef<Protocol> actorRef = // spawned actor
null; // #hidden
final Ack ackMessage = new Ack();
final Complete completeMessage = new Complete();
final Sink<String, NotUsed> sink =
@ -66,7 +67,7 @@ public class ActorSinkWithAckExample {
actorRef,
(responseActorRef, element) -> new Message(responseActorRef, element),
(responseActorRef) -> new Init(responseActorRef),
ackMessage,
Ack.INSTANCE,
completeMessage,
(exception) -> new Fail(exception));