]> Sergey Matveev's repositories - public-inbox.git/commit
qspawn: shorten lifetime of circular references
authorEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:31:20 +0000 (08:31 +0000)
committerEric Wong <e@80x24.org>
Tue, 17 Sep 2019 08:31:44 +0000 (08:31 +0000)
commit685da5f572042faa54fb4479c222d4f2d258e2ed
treebab369d4db5a7489d543a64905088a8d416502aa
parent641191aa902bb3259a13d0f348b78a49aafe4902
qspawn: shorten lifetime of circular references

All of these circular references are designed to clear
themselves, but these will make actual errors from Devel::Cycle
easier-to-spot.

The circular reference in the limiter {run_queue} is not a real
problem, but we can avoid storing the circular reference until
we actually need to spawn the child, reducing the size of the
Qspawn object while it's in the queue, slightly.

We also do not need to have redundant checks to spawn new
processes, we should only spawn new processes when they're
->start-ed or after waitpid reaps them.
lib/PublicInbox/Qspawn.pm