Linked Questions

Popular Questions

With Akka Streams, how do I know when a source has completed?

Asked by At

I have an Alpakka Elasticsearch Sink that I'm keeping around between requests. When I get a request, I create a Source from an HTTP request and turn that into a Source of Elasticsearch WriteMessages, then run that with mySource.runWith(theElasticseachSink).

  1. How do I get notified when the source has completed? Nothing useful seems to be materialized.
  2. Will completion of the source be passed to the sink, meaning I have to create a new one each time?
  3. If yes to the above, would decoupling them somehow with Flow.fromSourceAndSink help?

My goal is to know when the HTTP download has completed (including the vias it goes through) and to be able to reuse the sink.

Related Questions