Expose capacity property on StashBuffer (#28739)
This commit is contained in:
parent
b035c42691
commit
3ccaee2c18
4 changed files with 24 additions and 0 deletions
|
|
@ -241,5 +241,11 @@ class StashBufferSpec extends AnyWordSpec with Matchers with LogCapturing {
|
|||
intercept[IllegalArgumentException](stash.unstashAll(Behaviors.unhandled))
|
||||
}
|
||||
|
||||
"answer thruthfully about its capacity" in {
|
||||
val capacity = 42
|
||||
val stash = StashBuffer[String](context, capacity)
|
||||
|
||||
stash.capacity should ===(capacity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
# https://github.com/akka/akka/pull/28739#issuecomment-602527515
|
||||
# StashBuffer trait is not meant to be extended by external users, and is marked as such with a @DoNotInherit
|
||||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.javadsl.StashBuffer.capacity")
|
||||
ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.actor.typed.scaladsl.StashBuffer.capacity")
|
||||
|
|
@ -42,6 +42,13 @@ import akka.japi.function.Procedure
|
|||
*/
|
||||
def size: Int
|
||||
|
||||
/**
|
||||
* What is the capacity of this buffer.
|
||||
*
|
||||
* @return the capacity of this buffer
|
||||
*/
|
||||
def capacity: Int
|
||||
|
||||
/**
|
||||
* @return `true` if no more messages can be added, i.e. size equals the capacity of the stash buffer
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -55,6 +55,13 @@ import akka.annotation.{ DoNotInherit, InternalApi }
|
|||
*/
|
||||
def size: Int
|
||||
|
||||
/**
|
||||
* What is the capacity of this buffer.
|
||||
*
|
||||
* @return the capacity of this buffer
|
||||
*/
|
||||
def capacity: Int
|
||||
|
||||
/**
|
||||
* @return `true` if no more messages can be added, i.e. size equals the capacity of the stash buffer
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue