These are chat archives for akkadotnet/akka.net

3rd
Apr 2016
Alex Valuyskiy
@alexvaluyskiy
Apr 03 2016 19:27
This message was deleted

@Horusiath, I've been trying Akka.Streams, and I have couple of questions. For example I have this Scala code

  override def eventsByTag(tag: String, offset: Long = 0L): Source[EventEnvelope, NotUsed] = {
    Source.actorPublisher[EventEnvelope](EventsByTagPublisher.props(tag, offset, Long.MaxValue,
      refreshInterval, maxBufSize, writeJournalPluginId)).mapMaterializedValue(_ ⇒ NotUsed)
      .named("eventsByTag-" + URLEncoder.encode(tag, ByteString.UTF_8))
  }

1) What should I use, instead of NotUsed? Unit/Unit.Instanse or something else?
2) I should return Source<EventEnvelope, Unit>, but method "Named" returns IGraph<SourceShape<EventEnvelope>, NotUsed>. How to convert SourceShape<T> to T?

Marc Piechura
@marcpiechura
Apr 03 2016 19:35
@alexvaluyskiy yep we are using Unit as NotUsed
2 Use Source.FromGraph to cast the graph back into a source