feat(tvix/store/directorysvc): add put_multiple_start
This provides a handle to upload multiple proto::Directory as part of the same closure. Change-Id: I9213dde257a260c8622239918ea541064b270484 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8356 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
parent
96d7f4f0ac
commit
0836450006
5 changed files with 281 additions and 12 deletions
|
|
@ -4,6 +4,7 @@ use std::collections::HashMap;
|
|||
use std::sync::{Arc, RwLock};
|
||||
use tracing::{instrument, warn};
|
||||
|
||||
use super::utils::SimplePutter;
|
||||
use super::{DirectoryService, DirectoryTraverser};
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
|
|
@ -74,4 +75,14 @@ impl DirectoryService for MemoryDirectoryService {
|
|||
fn get_recursive(&self, root_directory_digest: &[u8; 32]) -> Self::DirectoriesIterator {
|
||||
DirectoryTraverser::with(self.clone(), root_directory_digest)
|
||||
}
|
||||
|
||||
type DirectoryPutter = SimplePutter<Self>;
|
||||
|
||||
#[instrument(skip_all)]
|
||||
fn put_multiple_start(&self) -> Self::DirectoryPutter
|
||||
where
|
||||
Self: Clone,
|
||||
{
|
||||
SimplePutter::new(self.clone())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue