CircularKeep actor
Rocket.circularkeep
— Functioncircularkeep(::Type{T}, capacity::Int) where T
Arguments
::Type{T}
: Type of keep datacapacity::Int
: circular buffer capacity
Creation operator for the CircularKeepActor
actor.
Examples
using Rocket
actor = circularkeep(Int, 3)
actor isa CircularKeepActor{Int}
# output
true
See also: CircularKeepActor
, AbstractActor
Rocket.CircularKeepActor
— TypeCirucalKeepActor{D}() where D
Circual keep actor is similar to keep actor, but uses CircularBuffer
as a storage. It saves all incoming successful next
events in a values
circular buffer, throws an ErrorException on error!
event and does nothing on completion event.
Examples
using Rocket
source = from(1:5)
actor = circularkeep(Int, 3)
subscribe!(source, actor)
show(getvalues(actor))
# output
[3, 4, 5]
See also: Actor
, keep
, circularkeep