EventStore

interface EventStore

The component that persists and buffers events before sending.

Functions

Link copied to clipboard
abstract fun add(payload: Payload)

Adds an event to the store.

Link copied to clipboard
abstract fun getEmittableEvents(queryLimit: Int): List<EmitterEvent>

Returns a list of EmitterEvent objects which contain events and related IDs.

Link copied to clipboard
abstract fun removeAllEvents(): Boolean

Empties the store of all the events.

Link copied to clipboard
abstract fun removeEvent(id: Long): Boolean

Removes an event from the store.

Link copied to clipboard
abstract fun removeEvents(ids: MutableList<Long>): Boolean

Removes a range of events from the store.

Link copied to clipboard
abstract fun removeOldEvents(maxSize: Long, maxAge: Duration)

Remove events older than maxAge seconds and keep only the latest maxSize events.

Link copied to clipboard
abstract fun size(): Long

Returns amount of events currently in the store.