about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiNoteEvent.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-19 12:50:22 +0000
committerEric Wong <e@80x24.org>2021-09-19 19:52:45 +0000
commitcbc2890cb89b81cb6b9e8fabf3f196d9a6110dce (patch)
tree5e8fc56e04b6b52d28c5853aca1bb5f9b98f36b7 /lib/PublicInbox/LeiNoteEvent.pm
parent12775b5be53db1244b9cb32ae2ef90f105735e1b (diff)
downloadpublic-inbox-cbc2890cb89b81cb6b9e8fabf3f196d9a6110dce.tar.gz
This has several advantages:

* no need to use ipc.lock to protect a pipe for non-atomic writes

* ability to pass FDs.  In another commit, this will let us
  simplify lei->sto_done_request and pass newly-created
  sockets to lei/store directly.

disadvantages:

- an extra pipe is required for rare messages over several
  hundred KB, this is probably a non-issue, though

The performance delta is unknown, but I expect shards
(which remain pipes) to be the primary bottleneck IPC-wise
for lei/store.
Diffstat (limited to 'lib/PublicInbox/LeiNoteEvent.pm')
-rw-r--r--lib/PublicInbox/LeiNoteEvent.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiNoteEvent.pm b/lib/PublicInbox/LeiNoteEvent.pm
index 18313359..5f692e75 100644
--- a/lib/PublicInbox/LeiNoteEvent.pm
+++ b/lib/PublicInbox/LeiNoteEvent.pm
@@ -36,18 +36,18 @@ sub eml_event ($$$$) {
         my ($self, $eml, $vmd, $state) = @_;
         my $sto = $self->{lei}->{sto};
         if ($state =~ /\Aimport-(?:rw|ro)\z/) {
-                $sto->ipc_do('set_eml', $eml, $vmd);
+                $sto->wq_do('set_eml', $eml, $vmd);
         } elsif ($state =~ /\Aindex-(?:rw|ro)\z/) {
                 my $xoids = $self->{lei}->ale->xoids_for($eml);
-                $sto->ipc_do('index_eml_only', $eml, $vmd, $xoids);
+                $sto->wq_do('index_eml_only', $eml, $vmd, $xoids);
         } elsif ($state =~ /\Atag-(?:rw|ro)\z/) {
                 my $docids = [];
                 my $c = $self->{lse}->kw_changed($eml, $vmd->{kw}, $docids);
                 if (scalar @$docids) { # already in lei/store
-                        $sto->ipc_do('set_eml_vmd', undef, $vmd, $docids) if $c;
+                        $sto->wq_do('set_eml_vmd', undef, $vmd, $docids) if $c;
                 } elsif (my $xoids = $self->{lei}->ale->xoids_for($eml)) {
                         # it's in an external, only set kw, here
-                        $sto->ipc_do('set_xvmd', $xoids, $eml, $vmd);
+                        $sto->wq_do('set_xvmd', $xoids, $eml, $vmd);
                 } # else { totally unknown: ignore
         } else {
                 warn "unknown state: $state (in $self->{lei}->{cfg}->{'-f'})\n";