private GraphActor(final BiFunction<ActorContext, DiagnosticLoggingAdapter, Graph<SinkShape<WithSender>, NotUsed>> graphCreator) { materializer = ActorMaterializer.create(getContext()); messageHandler = MergeHub.of(WithSender.class).to(graphCreator.apply(getContext(), log)).run(materializer); }
private GraphActor(final Function<ActorContext, Graph<SinkShape<WithSender>, NotUsed>> graphCreator) { materializer = ActorMaterializer.create(getContext()); messageHandler = MergeHub.of(WithSender.class).to(graphCreator.apply(getContext())).run(materializer); }
private GraphActor(final BiFunction<ActorContext, DiagnosticLoggingAdapter, Graph<SinkShape<WithSender>, NotUsed>> graphCreator) { materializer = ActorMaterializer.create(getContext()); messageHandler = MergeHub.of(WithSender.class).to(graphCreator.apply(getContext(), log)).run(materializer); }
private GraphActor(final Function<ActorContext, Graph<SinkShape<WithSender>, NotUsed>> graphCreator) { materializer = ActorMaterializer.create(getContext()); messageHandler = MergeHub.of(WithSender.class).to(graphCreator.apply(getContext())).run(materializer); }
public AkkaHubProxy(ActorMaterializer mat) { this.mat = mat; // Obtain a Sink and Source which will publish and receive from the "bus" respectively. Pair<Sink<Object, NotUsed>, Source<Object, NotUsed>> sinkAndSource = MergeHub.of(Object.class, 16) .toMat(BroadcastHub.of(Object.class, 256), Keep.both()) .run(mat); Sink<Object, NotUsed> sink = sinkAndSource.first(); source = sinkAndSource.second().takeWhile((Predicate<Object>) o -> o != Done.getInstance()); //source.runWith(Sink.ignore(), mat); busFlow = Flow.fromSinkAndSource(sink, source) .joinMat(KillSwitches.singleBidi(), Keep.right()); }