Class/Object

akka.actor.typed.javadsl

StashBuffer

Related Docs: object StashBuffer | package javadsl

Permalink

abstract class StashBuffer[T] extends AnyRef

A non thread safe mutable message buffer that can be used to buffer messages inside actors and then unstash them.

The buffer can hold at most the given capacity number of messages.

Not for user extension.

Annotations
@DoNotInherit()
Source
StashBuffer.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StashBuffer
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StashBuffer()

    Permalink

Abstract Value Members

  1. abstract def forEach(f: Consumer[T]): Unit

    Permalink

    Iterate over all elements of the buffer and apply a function to each element, without removing them.

    Iterate over all elements of the buffer and apply a function to each element, without removing them.

    f

    the function to apply to each element

  2. abstract def head: T

    Permalink

    Return the first element of the message buffer without removing it.

    Return the first element of the message buffer without removing it.

    returns

    the first element or throws NoSuchElementException if the buffer is empty

    Exceptions thrown

    `NoSuchElementException` if the buffer is empty

  3. abstract def isEmpty: Boolean

    Permalink

    Check if the message buffer is empty.

    Check if the message buffer is empty.

    returns

    if the buffer is empty

  4. abstract def isFull: Boolean

    Permalink

    returns

    true if no more messages can be added, i.e. size equals the capacity of the stash buffer

  5. abstract def nonEmpty: Boolean

    Permalink

    Check if the message buffer is not empty.

    Check if the message buffer is not empty.

    returns

    if the buffer is not empty

  6. abstract def size: Int

    Permalink

    How many elements are in the message buffer.

    How many elements are in the message buffer.

    returns

    the number of elements in the message buffer

  7. abstract def stash(message: T): StashBuffer[T]

    Permalink

    Add one element to the end of the message buffer.

    Add one element to the end of the message buffer.

    StashOverflowException is thrown if the buffer StashBuffer#isFull.

    message

    the message to buffer

    returns

    this message buffer

    Exceptions thrown

    `StashOverflowException` is thrown if the buffer StashBuffer#isFull.

  8. abstract def unstash(ctx: ActorContext[T], behavior: Behavior[T], numberOfMessages: Int, wrap: Function[T, T]): Behavior[T]

    Permalink

    Process numberOfMessages of the stashed messages with the behavior and the returned Behavior from each processed message.

    Process numberOfMessages of the stashed messages with the behavior and the returned Behavior from each processed message.

    The purpose of this method, compared to unstashAll, is to unstash a limited number of messages and then send a message to self before continuing unstashing more. That means that other new messages may arrive in-between and those must be stashed to keep the original order of messages. To differentiate between unstashed and new incoming messages the unstashed messages can be wrapped in another message with the wrap.

    If an exception is thrown by processing a message a proceeding messages and the message causing the exception have been removed from the StashBuffer, but unprocessed messages remain.

    It's allowed to stash messages while unstashing. Those newly added messages will not be processed by this call and have to be unstashed in another call.

  9. abstract def unstashAll(ctx: ActorContext[T], behavior: Behavior[T]): Behavior[T]

    Permalink

    Process all stashed messages with the behavior and the returned Behavior from each processed message.

    Process all stashed messages with the behavior and the returned Behavior from each processed message. The StashBuffer will be empty after processing all messages, unless an exception is thrown or messages are stashed while unstashing.

    If an exception is thrown by processing a message a proceeding messages and the message causing the exception have been removed from the StashBuffer, but unprocessed messages remain.

    It's allowed to stash messages while unstashing. Those newly added messages will not be processed by this call and have to be unstashed in another call.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to any2stringadd[StashBuffer[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (StashBuffer[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to ArrowAssoc[StashBuffer[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (StashBuffer[T]) ⇒ Boolean, msg: ⇒ Any): StashBuffer[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to Ensuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (StashBuffer[T]) ⇒ Boolean): StashBuffer[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to Ensuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): StashBuffer[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to Ensuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): StashBuffer[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to Ensuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to StringFormat[StashBuffer[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def [B](y: B): (StashBuffer[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from StashBuffer[T] to ArrowAssoc[StashBuffer[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from StashBuffer[T] to any2stringadd[StashBuffer[T]]

Inherited by implicit conversion StringFormat from StashBuffer[T] to StringFormat[StashBuffer[T]]

Inherited by implicit conversion Ensuring from StashBuffer[T] to Ensuring[StashBuffer[T]]

Inherited by implicit conversion ArrowAssoc from StashBuffer[T] to ArrowAssoc[StashBuffer[T]]

Ungrouped