Expose capacity property on StashBuffer (#28739)

This commit is contained in:
Ivan Oreskovic 2020-04-01 14:25:34 +02:00 committed by GitHub
parent b035c42691
commit 3ccaee2c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 0 deletions

View file

@ -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)
}
}
}

View file

@ -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")

View file

@ -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
*/

View file

@ -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
*/