akka/akka-core

Convenience for attributes on Sink

Ouverte

#30 199 ouverte le 22 avr. 2021

 (5 commentaires) (0 réaction) (0 personne assignée)Scala (3 547 forks)batch import
1 - triagedhelp wantedt:stream

Métriques du dépôt

Stars
 (13 277 étoiles)
Métriques de merge PR
 (Merge moyen 8j 19h) (10 PRs mergées en 30 j)

Description

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()

Guide contributeur