diff options
author | Eric Wong <e@80x24.org> | 2021-09-25 06:17:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-25 08:53:48 +0000 |
commit | d0100ddd9fe00197cc846d83e70b7611c57dbf43 (patch) | |
tree | e52ddb16cffcb623c7076fd026dde5037fc19933 /lib/PublicInbox/LeiXSearch.pm | |
parent | 562cae2dc6dfd8b6ae85094115f67fe8d57cec8e (diff) | |
download | public-inbox-d0100ddd9fe00197cc846d83e70b7611c57dbf43.tar.gz |
Since switching to SOCK_SEQUENTIAL, we no longer have to use fixed-width records to guarantee atomic reads. Thus we can maintain more human-readable/searchable PktOp opcodes. Furthermore, we can infer the subroutine name in many cases to avoid repeating ourselves by specifying a command-name twice (e.g. $ops->{CMD} => [ \&CMD, $obj ]; can now simply be written as: $ops->{CMD} => [ $obj ] if CMD is a method of $obj.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r-- | lib/PublicInbox/LeiXSearch.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 99f887ce..ae9f5881 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -536,16 +536,16 @@ sub do_query { my ($self, $lei) = @_; my $l2m = $lei->{l2m}; my $ops = { - '|' => [ $lei->can('sigpipe_handler'), $lei ], - '!' => [ $lei->can('fail_handler'), $lei ], - '.' => [ \&do_post_augment, $lei ], - '+' => [ \&incr_post_augment, $lei ], + 'sigpipe_handler' => [ $lei ], + 'fail_handler' => [ $lei ], + 'do_post_augment' => [ \&do_post_augment, $lei ], + 'incr_post_augment' => [ \&incr_post_augment, $lei ], '' => [ \&query_done, $lei ], 'mset_progress' => [ \&mset_progress, $lei ], 'l2m_progress' => [ \&l2m_progress, $lei ], - 'x_it' => [ $lei->can('x_it'), $lei ], - 'child_error' => [ $lei->can('child_error'), $lei ], - 'incr_start_query' => [ \&incr_start_query, $self, $l2m ], + 'x_it' => [ $lei ], + 'child_error' => [ $lei ], + 'incr_start_query' => [ $self, $l2m ], }; $lei->{auth}->op_merge($ops, $l2m) if $l2m && $lei->{auth}; my $end = $lei->pkt_op_pair; |