mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-02 03:06:06 -04:00
reconciliation work
This commit is contained in:
parent
c9525bde77
commit
490051a650
12 changed files with 457 additions and 196 deletions
|
@ -209,8 +209,7 @@ class DHTLog implements DHTDeleteable<DHTLog, DHTLog> {
|
|||
OwnedDHTRecordPointer get recordPointer => _spine.recordPointer;
|
||||
|
||||
/// Runs a closure allowing read-only access to the log
|
||||
Future<T?> operate<T>(
|
||||
Future<T?> Function(DHTLogReadOperations) closure) async {
|
||||
Future<T> operate<T>(Future<T> Function(DHTLogReadOperations) closure) async {
|
||||
if (!isOpen) {
|
||||
throw StateError('log is not open"');
|
||||
}
|
||||
|
|
|
@ -108,6 +108,7 @@ class DHTLogCubit<T> extends Cubit<DHTLogBusyState<T>>
|
|||
elements: elements, tail: _tail, count: _count, follow: _follow)));
|
||||
}
|
||||
|
||||
// Tail is one past the last element to load
|
||||
Future<AsyncValue<IList<DHTLogElementState<T>>>> loadElements(
|
||||
int tail, int count,
|
||||
{bool forceRefresh = false}) async {
|
||||
|
@ -184,8 +185,7 @@ class DHTLogCubit<T> extends Cubit<DHTLogBusyState<T>>
|
|||
await super.close();
|
||||
}
|
||||
|
||||
Future<R?> operate<R>(
|
||||
Future<R?> Function(DHTLogReadOperations) closure) async {
|
||||
Future<R> operate<R>(Future<R> Function(DHTLogReadOperations) closure) async {
|
||||
await _initWait();
|
||||
return _log.operate(closure);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue