Packages

object ActorFlow

Collection of Flows aimed at integrating with typed Actors.

Source
ActorFlow.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ActorFlow
  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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def ask[I, Q, A](parallelism: Int)(ref: ActorRef[Q])(makeMessage: (I, ActorRef[A]) => Q)(implicit timeout: Timeout): Flow[I, A, NotUsed]

    Use the ask pattern to send a request-reply message to the target ref actor.

    Use the ask pattern to send a request-reply message to the target ref actor. If any of the asks times out it will fail the stream with a java.util.concurrent.TimeoutException.

    Do not forget to include the expected response type in the method call, like so:

    flow.via(ActorFlow.ask[String, Asking, Reply](parallelism = 4)(ref, (el, replyTo) => Asking(el, replyTo)))
    
    // or even:
    flow.via(ActorFlow.ask[String, Asking, Reply](parallelism = 4)(ref, Asking(_, _)))

    otherwise Nothing will be assumed, which is most likely not what you want.

    The operator fails with an akka.stream.WatchedActorTerminatedException if the target actor is terminated, or with an java.util.concurrent.TimeoutException in case the ask exceeds the timeout passed in.

    Adheres to the ActorAttributes.SupervisionStrategy attribute.

    Emits when the futures (in submission order) created by the ask pattern internally are completed

    Backpressures when the number of futures reaches the configured parallelism and the downstream backpressures

    Completes when upstream completes and all futures have been completed and all elements have been emitted

    Fails when the passed in actor terminates, or a timeout is exceeded in any of the asks performed

    Cancels when downstream cancels

    I

    Incoming element type of the Flow

    Q

    Question message type that is spoken by the target actor

    A

    answer type that the Actor is expected to reply with, it will become the Output type of this Flow

    Annotations
    @implicitNotFound()
  6. def ask[I, Q, A](ref: ActorRef[Q])(makeMessage: (I, ActorRef[A]) => Q)(implicit timeout: Timeout): Flow[I, A, NotUsed]

    Use the ask pattern to send a request-reply message to the target ref actor.

    Use the ask pattern to send a request-reply message to the target ref actor. If any of the asks times out it will fail the stream with a java.util.concurrent.TimeoutException.

    Do not forget to include the expected response type in the method call, like so:

    flow.via(ActorFlow.ask[String, Asking, Reply](ref)((el, replyTo) => Asking(el, replyTo)))
    
    // or even:
    flow.via(ActorFlow.ask[String, Asking, Reply](ref)(Asking(_, _)))

    otherwise Nothing will be assumed, which is most likely not what you want.

    Defaults to parallelism of 2 messages in flight, since while one ask message may be being worked on, the second one still be in the mailbox, so defaulting to sending the second one a bit earlier than when first ask has replied maintains a slightly healthier throughput.

    The operator fails with an akka.stream.WatchedActorTerminatedException if the target actor is terminated, or with an java.util.concurrent.TimeoutException in case the ask exceeds the timeout passed in.

    Adheres to the ActorAttributes.SupervisionStrategy attribute.

    Emits when the futures (in submission order) created by the ask pattern internally are completed

    Backpressures when the number of futures reaches the configured parallelism and the downstream backpressures

    Completes when upstream completes and all futures have been completed and all elements have been emitted

    Fails when the passed in actor terminates, or a timeout is exceeded in any of the asks performed

    Cancels when downstream cancels

    I

    Incoming element type of the Flow

    Q

    Question message type that is spoken by the target actor

    A

    Answer type that the Actor is expected to reply with, it will become the Output type of this Flow

    Annotations
    @implicitNotFound()
  7. def askWithContext[I, Q, A, Ctx](parallelism: Int)(ref: ActorRef[Q])(makeMessage: (I, ActorRef[A]) => Q)(implicit timeout: Timeout): Flow[(I, Ctx), (A, Ctx), NotUsed]

    Use the ask pattern to send a request-reply message to the target ref actor without including the context.

    Use the ask pattern to send a request-reply message to the target ref actor without including the context.

    Annotations
    @implicitNotFound()
  8. def askWithContext[I, Q, A, Ctx](ref: ActorRef[Q])(makeMessage: (I, ActorRef[A]) => Q)(implicit timeout: Timeout): Flow[(I, Ctx), (A, Ctx), NotUsed]

    Use the ask pattern to send a request-reply message to the target ref actor without including the context.

    Use the ask pattern to send a request-reply message to the target ref actor without including the context.

    Annotations
    @implicitNotFound()
  9. def askWithStatus[I, Q, A](parallelism: Int)(ref: ActorRef[Q])(makeMessage: (I, ActorRef[StatusReply[A]]) => Q)(implicit timeout: Timeout): Flow[I, A, NotUsed]

    Use for messages whose response is known to be a akka.pattern.StatusReply.

    Use for messages whose response is known to be a akka.pattern.StatusReply. When a akka.pattern.StatusReply#success response arrives the future is completed with the wrapped value, if a akka.pattern.StatusReply#error arrives the future is instead failed.

  10. def askWithStatus[I, Q, A](ref: ActorRef[Q])(makeMessage: (I, ActorRef[StatusReply[A]]) => Q)(implicit timeout: Timeout): Flow[I, A, NotUsed]

    Use for messages whose response is known to be a akka.pattern.StatusReply.

    Use for messages whose response is known to be a akka.pattern.StatusReply. When a akka.pattern.StatusReply#success response arrives the future is completed with the wrapped value, if a akka.pattern.StatusReply#error arrives the future is instead failed.

  11. def askWithStatusAndContext[I, Q, A, Ctx](parallelism: Int)(ref: ActorRef[Q])(makeMessage: (I, ActorRef[StatusReply[A]]) => Q)(implicit timeout: Timeout): Flow[(I, Ctx), (A, Ctx), NotUsed]

    Use for messages whose response is known to be a akka.pattern.StatusReply.

    Use for messages whose response is known to be a akka.pattern.StatusReply. When a akka.pattern.StatusReply#success response arrives the future is completed with the wrapped value, if a akka.pattern.StatusReply#error arrives the future is instead failed.

  12. def askWithStatusAndContext[I, Q, A, Ctx](ref: ActorRef[Q])(makeMessage: (I, ActorRef[StatusReply[A]]) => Q)(implicit timeout: Timeout): Flow[(I, Ctx), (A, Ctx), NotUsed]

    Use for messages whose response is known to be a akka.pattern.StatusReply.

    Use for messages whose response is known to be a akka.pattern.StatusReply. When a akka.pattern.StatusReply#success response arrives the future is completed with the wrapped value, if a akka.pattern.StatusReply#error arrives the future is instead failed.

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

Deprecated Value Members

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

Inherited from AnyRef

Inherited from Any

Ungrouped