make fn clearable
This commit is contained in:
11
src/state.rs
11
src/state.rs
@@ -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();
|
||||
|
Reference in New Issue
Block a user