This whole area of async boundaries in akka streams is still very confusing
to me. I don't know what to suggest in terms of documentation, other than
numerous examples of code, with corresponding diagrams showing the
resultant boundaries and actor instances after materialization.

As an example, I have a Sink which I use for console output. I'm sure you
will tell me to use logging, but I didn't wish to deal with log levels and
formatting for what is the real UI of the tool.

So I have a  Sink:

  def printSinkWithLabel[T](extractor: T => String): Sink[T, Future[akka.Done]]
= Sink.foreach[T] { e => println(extractor(e)) }

    .withAttributes(ActorAttributes.dispatcher(
"dispatcher-for-blocking-console"))

    .async // Should I have this?

and a flow which uses it in an alsoTo()

  def progress[T](extractor: T => String) = {

    val flow = Flow[T]

    .alsoTo(Sinks.printSinkWithLabel(extractor) )

    .withAttributes(ActorAttributes.dispatcher(
"dispatcher-for-blocking-console"))

    flow

  }

WIth these I can do a via(progress(extractor)) as needed.

Do I need the dispatcher attributes in both places? Which is more
appropriate? Is the .async on the Sink necessary/appropriate? Does it make
any difference if it's before or after the withAttributes?
Thanks in advance.

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to