]> Sergey Matveev's repositories - public-inbox.git/commit
lei_mirror: eliminate circular references
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:32:24 +0000 (05:32 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:59 +0000 (23:38 +0000)
commitf6f581b57915e0bc07361d8a03da863b4117f910
tree86a786e0d2ccd281b34e7ff3bc113100b7167dc5
parente7e3993a2c19b65b23e7d83c2c33ae8ce9f64035
lei_mirror: eliminate circular references

...by using local-ized globals.  While non-globals could work,
eliminating the {todo} and {fgrp_todo} refs in all sub-refs
is more error-prone and the `local' construct is convenient.

This allows us to get rid of the `delete $fgrp->{-fini}' call
in pack_refs and eliminates the indiscriminate reaping of all
processes before calling fgrp_fetch_all.  This means we can
fully depend on DESTROY to provide predictable dependency
handling while supporting parallelization.

Global $TODO and $FGRP_TODO now become SCALAR refs on
consumption so they can act as assertions to detect future bugs.
lib/PublicInbox/LeiMirror.pm