Cache class

A performance layer that batches upserts to not overwhelm SQLite

Constructors

Cache(MessageRepository messageRepository)
Constructor to initialize the cache with the provided MessageRepository.

Properties

hashCode → int
The hash code for this object.
no setterinherited
messageRepository ↔ MessageRepository
The repository used to store messages.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes of the timer when the cache is no longer needed.
getChannelMaxFetchedSequenceId(String channel) → Future<int>
Returns the highest sequence_id currently stored for the specified channel.
loadChannelMessages(String channel) → Future<List<Broadcast>>
Loads all locally cached Broadcast messages for a specific channel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onBroadcastChanged(Broadcast broadcast) → void
Invoked automatically when BroadcastStatus of the broadcast changes.
toString() → String
A string representation of this object.
inherited
upsertBroadcast(Broadcast broadcast) → void
Inserts or updates a single Broadcast event in the local storage.
upsertBroadcasts(List<Broadcast> broadcasts) → Future<void>
Adds a Broadcast message to the queue for future processing. If message processing is not currently running, it starts processing the queue.

Operators

operator ==(Object other) → bool
The equality operator.
inherited