Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Created February 7, 2022 22:52
Show Gist options
  • Save victorbrndls/542006062edd4ab55a99ac29a3be5652 to your computer and use it in GitHub Desktop.
Save victorbrndls/542006062edd4ab55a99ac29a3be5652 to your computer and use it in GitHub Desktop.
class MemoryMutationQueue {
private final List<MutationBatch> queue;
@Override
public boolean isEmpty() {
return queue.isEmpty();
}
}
class SQLiteMutationQueue {
private final SQLitePersistence db;
@Override
public boolean isEmpty() {
return db.query("SELECT batch_id FROM mutations WHERE uid = ? LIMIT 1")
.binding(uid)
.isEmpty();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment