bitter-ability-32190
05/24/2022, 7:56 PMbitter-ability-32190
05/24/2022, 7:57 PM@dataclass(frozen=True)
class Bikeshed:
input_digest: Digest
immutable_input_digests: FrozenDict[str, Digest]
use_nailgun: tuple[str, ...]
output_files: tuple[str, ...]
output_directories: tuple[str, ...]
@dataclass(frozen=True)
class CoalescedProcessBatch:
files_to_bikesheds = FrozenDict[str, Bikeshed]
to the rust equivalent:
#[derive(DeepSizeOf, Derivative, Clone, Debug, Eq, Serialize)]
#[derivative(PartialEq, Hash)]
pub struct Bikeshed {
pub input_digests: InputDigests,
pub output_files: BTreeSet<RelativePath>,
pub output_directories: BTreeSet<RelativePath>,
}
#[derive(DeepSizeOf, Derivative, Clone, Debug, Eq, Serialize)]
#[derivative(PartialEq, Hash)]
pub struct CoalescedProcessBatch {
pub files_to_bikesheds: BTreeMap<RelativePath, Bikeshed>,
bitter-ability-32190
05/24/2022, 7:58 PMinput_digest: Digest
immutable_input_digests: FrozenDict[str, Digest]
use_nailgun: tuple[str, ...]
into a Rust InputDigests
involves async store code, which Python::with_gil
doesn't allowbitter-ability-32190
05/24/2022, 7:59 PMPython::with_gil
return a future which we then await
.
I'm attempting the same, but stumbling very Hard. Namely because I'm doing this on N, instead of one (so trying to have a vector of futures and try_join_all
them)witty-crayon-22786
05/24/2022, 8:19 PMwitty-crayon-22786
05/24/2022, 8:20 PMVec<somesuch Future>
, then try_join_all
it outside of the gilābitter-ability-32190
05/24/2022, 8:20 PMbitter-ability-32190
05/24/2022, 8:21 PMOk(...)
s everywhere. I get the feeling if you're hammering out `Ok`s, everything IS NOT Ok
šwitty-crayon-22786
05/24/2022, 8:22 PMbitter-ability-32190
05/24/2022, 8:24 PMcollect()?
do?witty-crayon-22786
05/24/2022, 8:26 PMwitty-crayon-22786
05/24/2022, 8:26 PMwitty-crayon-22786
05/24/2022, 8:26 PMResult<T, E>
into a Result<Vec<T>, E>
:witty-crayon-22786
05/24/2022, 8:27 PM.collect::<Result<Vec<_>, _>>()
is usually sufficientwitty-crayon-22786
05/24/2022, 8:28 PMbitter-ability-32190
05/24/2022, 8:33 PMbitter-ability-32190
05/24/2022, 8:40 PMcollect()
code you postedbitter-ability-32190
05/24/2022, 9:01 PMwitty-crayon-22786
05/24/2022, 9:01 PMwitty-crayon-22786
05/24/2022, 9:01 PMbitter-ability-32190
05/24/2022, 9:02 PMOk
?bitter-ability-32190
05/25/2022, 4:13 PM