1Test2::Harness::Util::FUisleer::CJoSnOtNrLi(b3u)ted PerlTeDsotc2u:m:eHnatranteisosn::Util::File::JSONL(3)
2
3
4
6 Test2::Harness::Util::File::JSONL - Utility class for a JSONL file
7 (stream)
8
10 Subclass of Test2::Harness::Util::File and
11 Test2::Harness::Util::File::Stream which automatically handles
12 encoding/decoding JSONL data.
13
15 use Test2::Harness::Util::File::JSONL;
16
17 my $jsonl = Test2::Harness::Util::File::JSONL->new(name => '/path/to/file.jsonl');
18
19 while (1) {
20 my @items = $jsonl->poll(max => 1000) or last;
21 for my $item (@items) {
22 ... handle $item ...
23 }
24 }
25
26 or
27
28 use Test2::Harness::Util::File::JSONL;
29
30 my $jsonl = Test2::Harness::Util::File::JSONL->new(name => '/path/to/file.jsonl');
31
32 $jsonl->write({my => 'item', ... });
33 ...
34
36 See the base classes Test2::Harness::Util::File and
37 Test2::Harness::Util::File::Stream for methods.
38
40 The source code repository for Test2-Harness can be found at
41 http://github.com/Test-More/Test2-Harness/.
42
44 Chad Granum <exodist@cpan.org>
45
47 Chad Granum <exodist@cpan.org>
48
50 Copyright 2020 Chad Granum <exodist7@gmail.com>.
51
52 This program is free software; you can redistribute it and/or modify it
53 under the same terms as Perl itself.
54
55 See http://dev.perl.org/licenses/
56
57
58
59perl v5.32.1 2021-03-1T2est2::Harness::Util::File::JSONL(3)