mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-21 13:48:43 -04:00
Dht perf
This commit is contained in:
parent
8194a79ce4
commit
ae154f1bed
10 changed files with 340 additions and 289 deletions
|
@ -83,16 +83,13 @@ class AuthorInputQueue {
|
|||
}
|
||||
}
|
||||
|
||||
/// Remove a reconciled message and move to the next message
|
||||
/// Move the reconciliation cursor (_inputPosition) forward on the input
|
||||
/// queue and tees up the next message for processing
|
||||
/// Returns true if there is more work to do
|
||||
/// Returns false if there are no more messages to reconcile in this queue
|
||||
Future<bool> advance() async {
|
||||
final currentMessage = await getCurrentMessage();
|
||||
if (currentMessage == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Move current message to previous
|
||||
_previousMessage = _currentMessage;
|
||||
_previousMessage = await getCurrentMessage();
|
||||
_currentMessage = null;
|
||||
|
||||
while (true) {
|
||||
|
@ -178,7 +175,7 @@ class AuthorInputQueue {
|
|||
|
||||
// _inputPosition points to either before the input source starts
|
||||
// or the position of the previous element. We still need to set the
|
||||
// _currentMessage to the previous element so consume() can compare
|
||||
// _currentMessage to the previous element so advance() can compare
|
||||
// against it if we can.
|
||||
if (_inputPosition >= 0) {
|
||||
_currentMessage = currentWindow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue