TomMemoryStorage class
One device's view of remote.
Reachability is modelled in two switches rather than one because offline is not symmetric: a device cache serves reads while offline, so the ordinary offline document is one whose writes fail — which is precisely the case that produces a commit-journal entry, since the changeset can still be built. A full blackout (readsFail) is the weaker case where there is nothing to journal.
- Inheritance
-
- Object
- TomStorage
- TomMemoryStorage
Constructors
- TomMemoryStorage(TomMemoryRemote remote)
Properties
-
deleteFails
→ Set<
String> -
Locators whose deletion is refused — the storage layer's "removal
failed" shape, injected per locator.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headOfCalls ↔ int
-
One-locator head reads, so a test can show what an unbatched loop costs.
getter/setter pair
- headsOfCalls ↔ int
-
Batched head reads — the number of requests a tick actually spends.
getter/setter pair
- keyRequiredReason ↔ String?
-
When set, the container's bytes arrive but do not open.
getter/setter pair
- maxObjectBytes → int?
-
The largest a single path in a TomChangeset may be, or null when
the backend imposes no limit of its own.
no setterinherited
- onCommit ↔ void Function()?
-
Fired just before a commit is applied — the hook the edit-during-sync
test uses to land an edit inside a cycle.
getter/setter pair
- rateLimitedUntil ↔ DateTime?
-
When set, every request is refused for quota — the reachable but
throttled case, which is not the same failure as readsFail.
getter/setter pair
- rateLimitKind ↔ TomRateLimitKind
-
Which limit rateLimitedUntil stands for.
getter/setter pair
- readsFail ↔ bool
-
getter/setter pair
- remote → TomMemoryRemote
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- staleHead ↔ TomStaleHead?
-
When set, every head read answers with this value instead of the truth —
the shape a replica takes under eventual consistency.
getter/setter pair
- writesFail ↔ bool
-
getter/setter pair
Methods
-
adoptBackoff(
TomBackoffPolicy policy) → void -
Adopts how long to hold off after a rate limit that stated no instant.
inherited
-
cacheMetaScope(
String location) → List< String> ? -
The
meta/key prefix this backend keeps the records for the storage locationlocationunder, or null when it keeps none.inherited -
close(
) → void -
inherited
-
commit(
String locator, TomChangeset changeset, {String? expectedHead, String? message, TomCommitProgressSink? onProgress}) → Future< String> -
Applies
changesetatomically, refusing the write if the container has moved away fromexpectedHead.override -
delete(
String locator) → Future< void> -
Removes the whole container.
override
-
goOffline(
) → void - Puts the device offline in the ordinary sense: reads still come from the cache, writes do not reach the remote.
-
goOnline(
) → void -
handles(
String locator) → bool -
Whether this backend owns
locator's scheme.override -
headOf(
String locator) → Future< String?> -
The current revision of the container, or null when it does not exist.
override
-
headsOf(
Iterable< String> locators) → Future<Map< String, String?> > -
Answers every locator in one request, as the GitHub backend does for the
documents sharing a repository and branch.
override
-
list(
String locator) → Future< List< TomStorageEntry> > -
Entries directly inside the container at
locator.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBundle(
String locator) → Future< TomBundleMedium> -
The directory-shaped bundle at
locator, as a detached medium.override -
readBytes(
String locator) → Future< Uint8List> -
The whole container, for the single-file kind.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
withinPass<
T> (Future< T> body()) → Future<T> -
Runs
bodyas one pass: a stretch of work whose reads may share what the pass has already established about the remote.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited