make fn clearable
Some checks failed
CI/CD Pipeline / deploy (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2025-07-21 21:30:59 +02:00
parent 1a5271c796
commit c31ad4290e
3 changed files with 15 additions and 2 deletions

View File

@@ -16,6 +16,17 @@ impl AppState {
}
}
pub async fn reset(&self) {
// Clear all chunks
self.chunks.write().await.clear();
// Reset completion status
*self.complete.write().await = false;
// Notify any waiting tasks about the reset
self.notify.notify_waiters();
}
pub async fn add_chunk(&self, chunk: Bytes) {
self.chunks.write().await.push(chunk);
self.notify.notify_waiters();