Packages

trait 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
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. Protected

Abstract Value Members

  1. abstract def capacity: Int

    What is the capacity of this buffer.

    What is the capacity of this buffer.

    returns

    the capacity of this buffer

  2. abstract def clear(): Unit

    Removes all messages from the buffer.

  3. abstract def contains[U >: T](message: U): Boolean

    Tests whether this StashBuffer contains a given message.

    Tests whether this StashBuffer contains a given message.

    message

    the message to test

    returns

    true if the buffer contains the message, false otherwise.

  4. abstract def exists(predicate: (T) => Boolean): Boolean

    Tests whether a predicate holds for at least one element of this StashBuffer.

    Tests whether a predicate holds for at least one element of this StashBuffer.

    predicate

    the predicate used to test

    returns

    true if the predicate holds for at least one message, false otherwise.

  5. abstract def foreach(f: (T) => Unit): Unit

    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

  6. abstract def head: T

    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

  7. abstract def isEmpty: Boolean

    Check if the message buffer is empty.

    Check if the message buffer is empty.

    returns

    if the buffer is empty

  8. abstract def isFull: Boolean

    returns

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

  9. abstract def nonEmpty: Boolean

    Check if the message buffer is not empty.

    Check if the message buffer is not empty.

    returns

    if the buffer is not empty

  10. abstract def size: Int

    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

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

    Add one element to the end of the message buffer.

    Add one element to the end of the message buffer.

    message

    the message to buffer

    returns

    this message buffer

    Exceptions thrown

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

  12. abstract def unstash(behavior: Behavior[T], numberOfMessages: Int, wrap: (T) => T): Behavior[T]

    Transition to the given behavior and process numberOfMessages of the stashed messages.

    Transition to the given behavior and process numberOfMessages of the stashed messages. The messages will be processed in the same order they arrived.

    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.

    The behavior passed to unstash must not be unhandled.

  13. abstract def unstashAll(behavior: Behavior[T]): Behavior[T]

    Transition to the given behavior and process all stashed messages.

    Transition to the given behavior and process all stashed messages. Messages will be processed in the same order they arrived. 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.

    The behavior passed to unstashAll must not be unhandled.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toany2stringadd[StashBuffer[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (StashBuffer[T], B)
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toArrowAssoc[StashBuffer[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  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. def ensuring(cond: (StashBuffer[T]) => Boolean, msg: => Any): StashBuffer[T]
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toEnsuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (StashBuffer[T]) => Boolean): StashBuffer[T]
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toEnsuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): StashBuffer[T]
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toEnsuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): StashBuffer[T]
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toEnsuring[StashBuffer[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. 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

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toStringFormat[StashBuffer[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (StashBuffer[T], B)
    Implicit
    This member is added by an implicit conversion from StashBuffer[T] toArrowAssoc[StashBuffer[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped