Reputation: 34061
I am trying to create the materialize value, when I create a source as the following:
case class Info(value: String)
val source: Source[String, Future[Info]] = Source.single("Start")
But it does not work. How to create a source with materialize value?
Upvotes: 2
Views: 107
Reputation: 51648
Can you use mapMaterializedValue
?
val source: Source[String, Future[Info]] = Source.single("Start")
.mapMaterializedValue(_ => Future(Info("abc")))
Upvotes: 5