Packages

object ActorSource

Collection of Sources aimed at integrating with typed Actors.

Source
ActorSource.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ActorSource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def actorRef[T](completionMatcher: PartialFunction[T, Unit], failureMatcher: PartialFunction[T, Throwable], bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, ActorRef[T]]

    Creates a Source that is materialized as an akka.actor.typed.ActorRef.

    Creates a Source that is materialized as an akka.actor.typed.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received.

    Depending on the defined akka.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.

    The strategy akka.stream.OverflowStrategy.backpressure is not supported, and an IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument.

    The buffer can be disabled by using bufferSize of 0 and then received messages are dropped if there is no demand from downstream. When bufferSize is 0 the overflowStrategy does not matter.

    The stream can be completed successfully by sending the actor reference a message that is matched by completionMatcher in which case already buffered elements will be signaled before signaling completion.

    The stream can be completed with failure by sending a message that is matched by failureMatcher. The extracted Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched by completionMatcher) before signaling completion and it receives a message matched by failureMatcher, the failure will be signaled downstream immediately (instead of the completion signal).

    The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.

    See also akka.stream.scaladsl.Source.queue.

    bufferSize

    The size of the buffer in element count

    overflowStrategy

    Strategy that is used when incoming elements cannot fit inside the buffer

  5. def actorRefWithBackpressure[T, Ack](ackTo: ActorRef[Ack], ackMessage: Ack, completionMatcher: PartialFunction[T, CompletionStrategy], failureMatcher: PartialFunction[T, Throwable]): Source[T, ActorRef[T]]

    Creates a Source that is materialized as an akka.actor.typed.ActorRef.

    Creates a Source that is materialized as an akka.actor.typed.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, and a new message will only be accepted after the previous messages has been consumed and acknowledged back. The stream will complete with failure if a message is sent before the acknowledgement has been replied back.

    The stream can be completed by sending a message that is matched by completionMatcher which decides if the stream is to drained before completion or should complete immediately.

    A message that is matched by failureMatcher fails the stream. The extracted Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched by completionMatcher) before signaling completion and it receives a message matched by failureMatcher, the failure will be signaled downstream immediately (instead of the completion signal).

    The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.

    ackTo

    actor to be signalled when an element has been emitted to the stream

    ackMessage

    a fixed message to be sent to ackTo to signal demand

    completionMatcher

    a partial function applied to the messages received materialized actor, a matching message will complete the stream with the return CompletionStrategy

    failureMatcher

    a partial function applied to the messages received materialized actor, a matching message will fail the stream with the returned Throwable

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def actorRefWithAck[T, Ack](ackTo: ActorRef[Ack], ackMessage: Ack, completionMatcher: PartialFunction[T, CompletionStrategy], failureMatcher: PartialFunction[T, Throwable]): Source[T, ActorRef[T]]

    Creates a Source that is materialized as an akka.actor.typed.ActorRef.

    Creates a Source that is materialized as an akka.actor.typed.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, and a new message will only be accepted after the previous messages has been consumed and acknowledged back. The stream will complete with failure if a message is sent before the acknowledgement has been replied back.

    The stream can be completed with failure by sending a message that is matched by failureMatcher. The extracted Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched by completionMatcher) before signaling completion and it receives a message matched by failureMatcher, the failure will be signaled downstream immediately (instead of the completion signal).

    The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use actorRefWithBackpressure instead

  2. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped