cubepod_sync 0.1.2 copy "cubepod_sync: ^0.1.2" to clipboard
cubepod_sync: ^0.1.2 copied to clipboard

A core component of the CubePod Application Runtime. Provides cubepod_sync functionalities.

cubepod_sync #

Offline-first sync queue for CubePod. Queues local writes and replays them to your backend when the device comes back online. Handles retries, dead-letter queuing, and ordering automatically.

What's inside #

  • SyncQueue — durable queue of pending sync operations
  • Automatic retry with configurable backoff
  • Dead-letter queue for operations that fail after all retries
  • Ordering guarantees — operations replay in the order they were queued

Install #

dependencies:
  cubepod_sync: ^0.1.1

Usage #

import 'package:cubepod_sync/cubepod_sync.dart';

final queue = SyncQueue(storage: LocalStorage());

// Queue a write when offline
await queue.enqueue(SyncOperation(
  id: uuid(),
  type: 'update_profile',
  payload: user.toJson(),
));

// When back online, replay everything
await queue.flush(handler: (op) => api.apply(op));

See cubepod for the full docs.

0
likes
0
points
340
downloads

Publisher

unverified uploader

Weekly Downloads

A core component of the CubePod Application Runtime. Provides cubepod_sync functionalities.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cubepod_async, cubepod_storage, flutter

More

Packages that depend on cubepod_sync