Buffer actor

Rocket.bufferFunction
buffer(::Type{T}, size::Int) where T

Arguments

  • ::Type{T}: Type of data in buffer
  • size::Int: size of buffer

Creation operator for the BufferActor actor.

Examples

using Rocket

actor = buffer(Int, 3)
actor isa BufferActor{Int}

# output
true

See also: BufferActor, AbstractActor

source
Rocket.BufferActorType
BufferActor{D}() where D

Buffer actor provides a storage actor. It copies last incoming successful next events in a values array, throws an ErrorException on error! event and does nothing on completion event. Note: Actor does not check the size of incoming data.

Examples

using Rocket

source = of([ 1, 2, 3 ])
actor  = buffer(Int, 3)

subscribe!(source, actor)
show(getvalues(actor))

# output
[1, 2, 3]

See also: Actor, buffer

source