diff options
Diffstat (limited to 'lib/PublicInbox/PktOp.pm')
-rw-r--r-- | lib/PublicInbox/PktOp.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/PktOp.pm b/lib/PublicInbox/PktOp.pm index 10942dd1..fd2569ba 100644 --- a/lib/PublicInbox/PktOp.pm +++ b/lib/PublicInbox/PktOp.pm @@ -13,6 +13,7 @@ use Errno qw(EAGAIN EINTR); use PublicInbox::Syscall qw(EPOLLIN EPOLLET); use Socket qw(AF_UNIX MSG_EOR SOCK_SEQPACKET); use PublicInbox::IPC qw(ipc_freeze ipc_thaw); +use Scalar::Util qw(blessed); sub new { my ($cls, $r) = @_; @@ -57,8 +58,8 @@ sub event_step { } my $op = $self->{ops}->{$cmd //= $msg}; if ($op) { - my ($sub, @args) = @$op; - $sub->(@args, @pargs); + my ($obj, @args) = (@$op, @pargs); + blessed($obj) ? $obj->$cmd(@args) : $obj->(@args); } elsif ($msg ne '') { die "BUG: unknown message: `$cmd'"; } |