How opposed would we be to make `CommandRunner::ru...
# general
r
How opposed would we be to make
CommandRunner::run
take a
&mut self
instead of an
&self
? The reason I ask is: - In the context of https://github.com/pantsbuild/pants/issues/8311, we want to keep a mutable map of live nailgun processes somewhere
Core
-scoped. - We will probably need to either heavily alter
local::CommandRunner
to add nailgun, or create a new
NailgunCommandRunner
that wraps it. Currently, neither local nor a custom command runner could hold the map of nailguns, because
run
takes an immutable reference. The solutions I can think of right now: - The map can go in
Core
, and we pass it to the respective CommandRunners, changing the signature of
CommandRunner.run
to be
run(&self, epr: MEPR, WorkunitStore, &mut NailgunPool)
. - The map can go into a
CommandRunner
, and we could handle connection separate to
run
, but then we are special-casing nailgun in the graph. - The map can go into a
CommandRunner
, and we could handle the connections at
run
time, and then we’d need to modify the signature of
run
a
i might ask in #engine but could we potentially wrap it in an
Arc<Mutex<_>>
or something?
r
Oh shoot, yeah
I forgot about interior mutability
a
that would just scope the mutability is the intention
r
Thanks!
❤️ 1
Also I really thought I was in #engine
It’s been a long day 🙂
a
thought so! but it’s not bad to have people see what’s happening with the new rust development haha
r
It is 🙂 Thanks again!
a
^_^!!!
w
a
thanks stu! great link!
as in, i personally find this really useful!