]> Sergey Matveev's repositories - public-inbox.git/commit
processpipe: allow synchronous close to set $?
authorEric Wong <e@80x24.org>
Sat, 2 Jan 2021 09:13:39 +0000 (19:13 -1400)
committerEric Wong <e@80x24.org>
Sat, 2 Jan 2021 22:38:49 +0000 (22:38 +0000)
commit6dd3c17ed185c0ed4569541dae52e0570be4deca
treee5b694ec690130e288361b1131959de3363195b0
parent0bd668ac6f15f791b626f5c644d23952c377b200
processpipe: allow synchronous close to set $?

To get rid of the ugly $PublicInbox::DS::in_loop localization
in MboxReader, we'll distinguish between ->CLOSE and ->DESTROY
with ProcessPipe.

If we end up closing via ->DESTROY, we'll assume the caller will
want to deal with $? asynchronously via the event loop (or not
even care about $?).

If we hit ->CLOSE directly, we'll assume the caller called
close() and wants to check $? synchronously.

Note: wantarray doesn't seem to propagate into tied methods,
otherwise I'd be relying on that.
lib/PublicInbox/MboxReader.pm
lib/PublicInbox/ProcessPipe.pm
lib/PublicInbox/Spawn.pm
t/mbox_reader.t
t/spawn.t