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_idcurrently stored for the specifiedchannel. -
loadChannelMessages(
String channel) → Future< List< Broadcast> > -
Loads all locally cached
Broadcastmessages for a specificchannel. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onBroadcastChanged(
Broadcast broadcast) → void -
Invoked automatically when BroadcastStatus of the
broadcastchanges. -
toString(
) → String -
A string representation of this object.
inherited
-
upsertBroadcast(
Broadcast broadcast) → void -
Inserts or updates a single
Broadcastevent in the local storage. -
upsertBroadcasts(
List< Broadcast> broadcasts) → Future<void> -
Adds a
Broadcastmessage 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