springroll.pbskids.BufferedQueue Class

Buffer event

Constructor

springroll.pbskids.BufferedQueue

(
  • batchSize
  • keyPrefix
  • eventServiceUrl
)

Parameters:

  • batchSize Int

    The number of events to buffer

  • keyPrefix String

    The prefix key for local storage

  • eventServiceUrl String

    The url

addToQueue

(
  • queueName
  • key
)
private

Defined in addToQueue:150

Add an item to the queue

Parameters:

  • queueName String

    The name of the queue

  • key String

    The key of the item to push

destroy

()

Defined in destroy:342

Destroy and don't use after this

disable

()

Defined in disable:243

Disable the queue

enable

()

Defined in enable:231

Enable the queue

end

()

Defined in end:331

End and clear the buffer

flushAll

()

Defined in flushAll:300

Flush all the event

getBufferQueue

(
  • queueName
)
Array
private

Defined in getBufferQueue:170

Add an item to the queue

Parameters:

  • queueName String

    The name of the queue to retrieve

Returns:

Array:

The list of keys

onTimerTick

()
private

Defined in onTimerTick:201

When the timer updates

processBatch

(
  • key
)
Boolean

Defined in processBatch:82

Process the batch of events

Parameters:

  • key String

    The key to process

Returns:

Boolean:

If the event is being processed

pushEvent

(
  • event
)

Defined in pushEvent:279

Push a new event

Parameters:

removeFromQueue

(
  • queueName
  • key
)
private

Defined in removeFromQueue:132

Remove an item to the queue by key

Parameters:

  • queueName String

    The name of the queue to remove from

  • key String

    The key of the item to remove

resetKey

()

Defined in resetKey:322

Reset the buffer key

setAutoFlush

(
  • on
)

Defined in setAutoFlush:252

Autoflush the event queue

Parameters:

  • on Boolean

    If we should autoflush

setOnline

(
  • isOnline
)

Defined in setOnline:269

Set the online status

Parameters:

  • isOnline Boolean

    If we are online

startTimer

()

Defined in startTimer:188

Start the buffer timer

stopTimer

()

Defined in stopTimer:221

Stop the buffer timer

batchSize

Int

Defined in batchSize:58

The number of events to buffer

currentBatch

Array

Defined in currentBatch:40

The buffer timer check

eventServiceUrl

String

Defined in eventServiceUrl:64

Path to the end-point

inTransitKeys

Object

Defined in inTransitKeys:46

The keys intransit

keyPrefix

String

Defined in keyPrefix:52

The buffer key prefix

onlineStatus

Boolean

Defined in onlineStatus:28

If we're online

queueName

String

Defined in queueName:70

The name of the localstorage name for the queue

timer

Int

Defined in timer:34

The buffer timer check