in Sources/TSFCASFileTree/FileTreeExport.swift [156:188]
func children(of item: Item, _ ctx: Context) -> LLBFuture<[Item]> {
_ = stats.downloadsInProgressObjects_.add(1)
let casObjectFuture: LLBFuture<LLBCASObject> = db.get(item.id, ctx).flatMapThrowing { casObject in
_ = self.stats.downloadsInProgressObjects_.add(-1)
guard let casObject = casObject else {
throw LLBExportError.missingReference(item.id)
}
_ = self.stats.bytesDownloaded_.add(casObject.data.readableBytes)
return casObject
}
if let batcher = self.storageBatcher {
return casObjectFuture.flatMap { casObject in
// Unblock the current NIO thread.
batcher.execute {
try self.parseAndMaterialize(casObject, item).map {
Item(id: $0.id, exportPath: $0.path, kindHint: $0.kind)
}
}
}
} else {
return casObjectFuture.flatMapThrowing { casObject in
try self.parseAndMaterialize(casObject, item).map {
Item(id: $0.id, exportPath: $0.path, kindHint: $0.kind)
}
}
}
}