Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(storage): forward collections and atomic_batch in host watching

Steven Enamakela8a22333c4ad
diff --git a/crates/openhuman-core/src/modules/storage_host_watching.rs b/crates/openhuman-core/src/modules/storage_host_watching.rs
index 695c5bf3f7..474b6dcbf9 100644
--- a/crates/openhuman-core/src/modules/storage_host_watching.rs
+++ b/crates/openhuman-core/src/modules/storage_host_watching.rs
@@ -13,7 +13,7 @@ use serde_json::Value;
use tinystoragedrivers::{
async_trait, Capabilities, Capability, CollectionSpec, DocumentStore, DocumentWatch, Filter,
MemoryStorage, Page, Precondition, Query, Result, Scope, ScopedStorage, Sort, StorageBackend,
- Version, Versioned, WatchNotice, WatchOptions,
+ Version, Versioned, WatchNotice, WatchOptions, WriteOp, WriteResult,
};
use tokio::sync::broadcast;
@@ -153,4 +153,14 @@ impl DocumentStore for Documents {
async fn drop_collection(&self, c: &str) -> Result<()> {
self.inner.drop_collection(c).await
}
+
+ async fn collections(&self, prefix: &str) -> Result<Vec<String>> {
+ self.inner.collections(prefix).await
+ }
+
+ async fn atomic_batch(&self, ops: Vec<WriteOp>) -> Result<Vec<WriteResult>> {
+ let results = self.inner.atomic_batch(ops).await?;
+ let _ = self.changed.send(());
+ Ok(results)
+ }
}