Table of Contents

Class StreamingSyncImplementation

Namespace
PowerSync.Common.Client.Sync.Stream
Assembly
PowerSync.Common.dll
public class StreamingSyncImplementation : ICloseable
Inheritance
StreamingSyncImplementation
Implements
Inherited Members

Constructors

StreamingSyncImplementation(StreamingSyncImplementationOptions)

Fields

DEFAULT_CRUD_UPLOAD_THROTTLE_MS
DEFAULT_RETRY_DELAY_MS
DEFAULT_STREAM_CONNECTION_OPTIONS

Properties

CancellationTokenSource
ConnectionOptions
Events
IsConnected

Indicates if the sync service is connected.

LastSyncedAt

The timestamp of the last successful sync.

Options
SyncStatus

The current synchronization status.

Methods

Close()
Connect(PowerSyncConnectionOptions?)
CrudUploadLoop(CancellationToken, PowerSyncConnectionOptions)

Uploads local writes for as long as the connection lasts: once on connect, and then whenever TriggerCrudUpload() signals that there may be more.

Disconnect()
DownloadLoop(CancellationToken, PowerSyncConnectionOptions)
InternalUploadAllCrud(CancellationToken, PowerSyncConnectionOptions)
RepostUnacknowledgedCheckpointRequests(CancellationToken, PowerSyncConnectionOptions)

Periodically re-posts the current checkpoint request while the service has not applied it yet.

The service is allowed to forget checkpoint requests, and re-posting an id it has already seen is a cheap no-op, so this doubles as a catch-all for requests lost to network failures.

RustStreamingSyncIteration(CancellationToken?, RequiredPowerSyncConnectionOptions)
StreamingSync(CancellationToken?, PowerSyncConnectionOptions?)
StreamingSyncIteration(CancellationToken, PowerSyncConnectionOptions?)
TriggerCrudUpload()

Requests a CRUD upload, without waiting for it to complete.

UpdateSubscriptions(SubscribedStream[])
UpdateSyncStatus(SyncStatusOptions, UpdateSyncStatusOptions?)
WaitForReady()