EventProcessingHistory

internal class EventProcessingHistory

In-memory event storage, used to check if an event was already dealt with and avoid duplication. i.e. present in both pending and live sources.

All operations are thread-safe.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun add(event: Event): Boolean

Adds an event to the end of this storage.

Link copied to clipboard
suspend fun clear()

Clears the storage, removes every previously added Event.

Link copied to clipboard
suspend fun clearHistoryIfLastEventEquals(event: Event): Boolean

Clears the whole storage if this event is the one added most recently.

Link copied to clipboard
suspend fun contains(event: Event): Boolean
Link copied to clipboard
suspend fun remove(event: Event): Boolean

Removes the event from this storage if present.