akka/akka-core

Convenience for attributes on Sink

Open

#30,199 创建于 2021年4月22日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Scala (13,277 star) (3,547 fork)batch import
1 - triagedhelp wantedt:stream

描述

When working on https://github.com/akka/akka-persistence-cassandra/pull/888 I realized that it wasn't obvious how to set a dispatcher all the way to the Sink (and not introduce async boundary).

My first thought, when I didn't realize that the Sink is also involved, was:

.map(stuff)
.withAttributes(ActorAttributes.dispatcher(theDispatcher))
.runWith(Sink.ignore)

but it should be:

.map(stuff)
.toMat(Sink.ignore)(Keep.right)
.withAttributes(ActorAttributes.dispatcher(theDispatcher))
.run()

贡献者指南