Skip to content

Instantly share code, notes, and snippets.

@kabergstrom
Created September 19, 2021 19:10
Show Gist options
  • Save kabergstrom/8faa39689cdff60c95a53cf0e7ac88a8 to your computer and use it in GitHub Desktop.
Save kabergstrom/8faa39689cdff60c95a53cf0e7ac88a8 to your computer and use it in GitHub Desktop.
impl ImportOp {
pub async fn fetch_kv(path: &Path, key: &str) -> Result<Vec<u8>> {
// like fetch_import_artifacts, except it fetches arbitrary key-value data
}
/// Store data with a named key
pub async fn store_kv(key: &str, data: Vec<u8>) {}
pub async fn fetch_import_artifact(
path: &IndirectIdentifer,
) -> Result<(ArtifactMetadata, Vec<u8>)> {
// IF this ImportOp is from a batch which contains the requested path,
// then block until the import processing loop has processed the target path,
// and use the metadata+artifact from the `metadata_changes` HashMap
// Otherwise, fetch metadata+artifact from database/regenerate it, similar to AssetHubService::get_import_artifacts.
// Record the path in the path_refs reverse index.
// Remove path refs that have been registered in a previous run, but are no longer being fetched.
// Detect cyclic dependencies?
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment