Remote
Dart: also in Python · Node · Go · Rust · Swift · Java and Kotlin · .NET · C++ · Objective-C
Reusable synchronization state for one remote.
A remote is the shared database copy described in Concepts. You own the Remote and can share it among databases and snapshots. Closing a database or snapshot never closes its remote. The remote refuses to close while any open database or snapshot uses it.
Creating one
Section titled “Creating one”fromDirectory
Section titled “fromDirectory”Open a directory remote rooted at path.
The directory is created on first use. Default options use readConcurrency 32 and bounded retention.
fromStorage
Section titled “fromStorage”Wrap a caller-supplied storage adapter as a remote.
storage implements the bucket storage protocol beneath the storage entry points. This is an integrator API. The S3 adapter is one implementation. Closing the remote never closes the adapter’s underlying transport for you.
Integrator API. This member exists for code that supplies its own storage transport. Application code reaches a bucket through Storage.fromS3, Storage.fromGcs and Storage.fromAzure.
Operations
Section titled “Operations”Close the remote. Repeated calls have the same effect.
close() fails with invalid_state while an open database or snapshot uses this remote. Refusal changes no state.
collect
Section titled “collect”Collect retired revisions under an explicit retention policy and return a CollectionReport.
Collection starts only above the retained target. It never touches the current head. Concepts explains retention and collection.
recoverAbandonedCollection
Section titled “recoverAbandonedCollection”Reopen a remote that an interrupted collection left cleaning.
Collection is interrupted if any of these occurs:
- Its process stops.
- It cannot learn whether its opening head swap took effect.
- Storage fails both a sweep step and its closing head swap.
Until the head reopens, every synchronization and new device initialization fails with temporarily_unavailable.
The next collection completes the sweep. If the head is open, this changes nothing and reports aborted. If there is no head, this changes nothing. It never retires a revision.
This operation is separate from collect. An accidental flag therefore cannot request recovery.
status
Section titled “status”Return a typed RemoteStatus snapshot of remote-owned state only.