Thank you. I suppose on a Source[T, Unit] the only option for an initial
materialized value is something provided externally or accessible through
the shape. I don't see any way to access attributes after supplying them,
for example. I don't actually have a use case for this now - just curious.
def makeSource(name:String): Source[Int, String] = {
val source: Source[Int, Unit] = Source(List(1,2,3)).named(name)
val mapped = source.mapMaterializedValue { x => name }
mapped
}
On Thu, Jan 28, 2016 at 12:03 AM, Viktor Klang <[email protected]>
wrote:
> mapMaterializedValue
>
> --
> Cheers,
> √
> On Jan 28, 2016 5:04 AM, "Richard Rodseth" <[email protected]> wrote:
>
>> I've since become aware that for something like counting a parent stream
>> for monitoring purposes I could use alsoTo to a counting sink.
>> But I'm still curious how a Source[T, Unit] becomes a Source[T, Mat], if
>> such a thing makes sense.
>>
>> On Wed, Jan 27, 2016 at 2:36 PM, Richard Rodseth <[email protected]>
>> wrote:
>>
>>> How does a Source[T, Unit] become a Source[T, M] ?
>>>
>>> I see that methods like via have a corresponding viaMat which let you
>>> provide a combiner to combine the materialized value of the previous stage
>>> and the next stage (I think)
>>>
>>> But how do you get the ball rolling with a Source?
>>>
>>> Say for example I have a stage that does a flatMapConcat and I want the
>>> final materialized value to contain a tuple of the count of the parent
>>> stream and a count of the final derived stream. I've done such counting
>>> using folds but only at the Sink level
>>>
>>> I believe I have read the relevant sections of the docs, so apologies if
>>> I am being slow on the uptake.
>>>
>>>
>>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.