object ActorSink
- Alphabetic
- By Inheritance
- ActorSink
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def actorRef[T](ref: ActorRef[T], onCompleteMessage: T, onFailureMessage: (Throwable) => T): Sink[T, NotUsed]
Sends the elements of the stream to the given
ActorRef.Sends the elements of the stream to the given
ActorRef. If the target actor terminates the stream will be canceled. When the stream is completed successfully the givenonCompleteMessagewill be sent to the destination actor. When the stream is completed with failure a the throwable that was signaled to the stream is adapted to the Actors protocol usingonFailureMessageand then then sent to the destination actor.It will request at most
maxInputBufferSizenumber 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 zeromailbox-push-timeout-timeor use a rate limiting stage in front of thisSink. - def actorRefWithBackpressure[T, M, A](ref: ActorRef[M], messageAdapter: (ActorRef[A], T) => M, onInitMessage: (ActorRef[A]) => M, onCompleteMessage: M, onFailureMessage: (Throwable) => M): Sink[T, NotUsed]
Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signals.Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signals. The first element is alwaysonInitMessage, then stream is waiting for acknowledgement message from the given actor which means that it is ready to process elements. It also requires an ack message after each stream element to make backpressure work. This variant will consider any message as ack message.If the target actor terminates the stream will be canceled. When the stream is completed successfully the given
onCompleteMessagewill be sent to the destination actor. When the stream is completed with failure - result ofonFailureMessage(throwable)function will be sent to the destination actor.- ref
the receiving actor as
ActorRef[T](whereTmust include the control messages below)- messageAdapter
a function that wraps the stream elements to be sent to the actor together with an
ActorRef[A]which accepts the ack message- onInitMessage
a function that wraps an
ActorRef[A]into a messages to couple the receiving actor to the sink- onCompleteMessage
the message to be sent to the actor when the stream completes
- onFailureMessage
a function that creates a message to be sent to the actor in case the stream fails from a
Throwable
- def actorRefWithBackpressure[T, M, A](ref: ActorRef[M], messageAdapter: (ActorRef[A], T) => M, onInitMessage: (ActorRef[A]) => M, ackMessage: A, onCompleteMessage: M, onFailureMessage: (Throwable) => M): Sink[T, NotUsed]
Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signals.Sends the elements of the stream to the given
ActorRefthat sends back back-pressure signals. The first element is alwaysonInitMessage, then stream is waiting for acknowledgement messageackMessagefrom the given actor which means that it is ready to process elements. It also requiresackMessagemessage after each stream element to make backpressure work.If the target actor terminates the stream will be canceled. When the stream is completed successfully the given
onCompleteMessagewill be sent to the destination actor. When the stream is completed with failure - result ofonFailureMessage(throwable)function will be sent to the destination actor.- ref
the receiving actor as
ActorRef[T](whereTmust include the control messages below)- messageAdapter
a function that wraps the stream elements to be sent to the actor together with an
ActorRef[A]which accepts the ack message- onInitMessage
a function that wraps an
ActorRef[A]into a messages to couple the receiving actor to the sink- ackMessage
a fixed message that is expected after every element sent to the receiving actor
- onCompleteMessage
the message to be sent to the actor when the stream completes
- onFailureMessage
a function that creates a message to be sent to the actor in case the stream fails from a
Throwable
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])