Sends the elements of the stream to the given ActorRef<T>ActorRef[T] of the new actors API, without considering backpressure.

Actor interop operators


This operator is included in:

val PekkoVersion = "1.0.2"
libraryDependencies += "org.apache.pekko" %% "pekko-stream-typed" % PekkoVersion
def versions = [
  ScalaBinary: "2.13"
dependencies {
  implementation platform("org.apache.pekko:pekko-bom_${versions.ScalaBinary}:1.0.2")

  implementation "org.apache.pekko:pekko-stream-typed_${versions.ScalaBinary}"




Sends the elements of the stream to the given ActorRef. If the target actor terminates the stream will be canceled. When the stream completes successfully the given onCompleteMessage will be sent to the destination actor. When the stream completes with failure the throwable that was signaled to the stream is adapted to the Actor’s protocol using onFailureMessage and then sent to the destination actor.

It will request at most maxInputBufferSize number of elements from upstream, but there is no back-pressure signal from the destination actor, i.e. if the actor is not consuming the messages fast enough the mailbox of the actor will grow. For potentially slow consumer actors it is recommended to use a bounded mailbox with zero mailbox-push-timeout-time or use a rate limiting operator in front of this Sink.

See also:

Reactive Streams semantics

cancels when the actor terminates

backpressures never