public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob 7ed58c247696e5c044f0725b8696c5ca562aa753 547 bytes (raw)
$ git show HEAD:lib/PublicInbox/LeiFinmsg.pm	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>

# Finalization messages, used to queue up a bunch of messages which
# only get written out on ->DESTROY
package PublicInbox::LeiFinmsg;
use strict;
use v5.10.1;

sub new {
	my ($cls, $lei) = @_;
	bless [ @$lei{qw(2 sock)}, $$ ], $cls;
}

sub DESTROY {
	my ($self) = @_;
	my ($stderr, $sock, $pid) = splice(@$self, 0, 3);
	print $stderr @$self if $pid == $$;
	# script/lei disconnects when $sock SvREFCNT drops to zero
}

1;

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git