]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_auth: simplify users
authorEric Wong <e@80x24.org>
Mon, 6 Sep 2021 12:58:03 +0000 (12:58 +0000)
committerEric Wong <e@80x24.org>
Mon, 6 Sep 2021 22:02:15 +0000 (22:02 +0000)
There's no need to alias net_merge_all in each WQ class
which uses LeiAuth, `$obj->$sub' works even when `$sub'
is a fully-qualified subroutine name with `::' in it.
perlobj(1) documents it under "Method Call Variations".

lib/PublicInbox/LeiAuth.pm
lib/PublicInbox/LeiExportKw.pm
lib/PublicInbox/LeiImport.pm
lib/PublicInbox/LeiIndex.pm
lib/PublicInbox/LeiLsMailSource.pm
lib/PublicInbox/LeiPruneMailSync.pm
lib/PublicInbox/LeiRediff.pm
lib/PublicInbox/LeiRm.pm
lib/PublicInbox/LeiTag.pm
lib/PublicInbox/LeiToMail.pm

index 73c0be599fc72a17b4c359015d42cd6fe8f75161..465a2758466851321c996189f79c30a22b06746d 100644 (file)
@@ -49,9 +49,10 @@ sub net_merge_all { # called in wq worker via wq_broadcast
 }
 
 # called by top-level lei-daemon when first worker is done with auth
+# passes updated net auth info to current workers
 sub net_merge_continue {
        my ($wq, $net_new) = @_;
-       $wq->wq_broadcast('net_merge_all', $net_new); # pass to current workers
+       $wq->wq_broadcast('PublicInbox::LeiAuth::net_merge_all', $net_new);
        $wq->net_merge_all_done; # defined per-WQ
 }
 
index 78c6c6f95ff36b36c44c90096c87aeace7109e79..d37f3768202619d434060981580ae27b0d2a76e0 100644 (file)
@@ -145,7 +145,4 @@ no warnings 'once';
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
-# the following works even when LeiAuth is lazy-loaded
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
-
 1;
index 7580e37e3674a2a0ab1a02a9213d981e80b22315..7c563bd8c8e79e864325cd0833e88d59406a120e 100644 (file)
@@ -133,6 +133,4 @@ no warnings 'once';
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
-# the following works even when LeiAuth is lazy-loaded
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 1;
index ef3e4d0b299af603b806d84d11e6c36217ecc423..1b327a2c1bc81904928e818893c8c929abac0fee 100644 (file)
@@ -43,6 +43,4 @@ for my $m (qw(pmdir_cb input_net_cb)) {
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
-# the following works even when LeiAuth is lazy-loaded
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 1;
index 2d8913ac9f090adf1af6ccd6148860be0fed32e3..71e253d9c476c954f8f68b86eeb29adcefdba95c 100644 (file)
@@ -114,6 +114,5 @@ sub _complete_ls_mail_source {
 no warnings 'once';
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 
 1;
index 98239a139762fe0adbf6e423ba3cfb5a9a5a5e2e..1a277122370bd634c5145ba6912d165ee027e1e9 100644 (file)
@@ -91,7 +91,6 @@ EOM
 no warnings 'once';
 *_complete_prune_mail_sync = \&PublicInbox::LeiExportKw::_complete_export_kw;
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
 1;
index 60286b065359430a1d6809ac073bea0482433428..ea9b2a643f9a0bb1334bdedca0c899e6840a3f35 100644 (file)
@@ -255,5 +255,4 @@ sub ipc_atfork_child {
 
 no warnings 'once';
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 1;
index 578e9811495080f2d620bcb52e0900db2331152c..778fa1de92763a14e49ff2e917048ecc86bb2a37 100644 (file)
@@ -44,6 +44,5 @@ sub lei_rm {
 no warnings 'once';
 *ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 
 1;
index 463fb9219749c0eb1b2f7b8860c23bb4fd3b3d96..44d77b881c04136c1f190e3e166298e100fd101c 100644 (file)
@@ -118,7 +118,6 @@ sub _complete_tag {
 }
 
 no warnings 'once'; # the following works even when LeiAuth is lazy-loaded
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
 1;
index 1221d3c77e1f6a7d521017d7414a44780763bf78..2c7a92de2130ff232c6f5580dbf87524ac5db003 100644 (file)
@@ -783,6 +783,4 @@ sub net_merge_all_done {
        $self->wq_close(1);
 }
 
-no warnings 'once'; # the following works even when LeiAuth is lazy-loaded
-*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
 1;