]> Sergey Matveev's repositories - public-inbox.git/blob - Documentation/lei-daemon.pod
92bc9ac543fa09e2171799f7a73e9077dfdbff49
[public-inbox.git] / Documentation / lei-daemon.pod
1 =head1 NAME
2
3 lei-daemon - technical information for local email interface daemon
4
5 =head1 DESCRIPTION
6
7 This documentation is a high-level overview for developers and
8 administrators interested in how lei works.
9
10 lei-daemon is a background daemon which powers the L<lei(1)>
11 command-line tool.  It may support virtual users and read-write
12 IMAP+JMAP APIs in the future.  It is designed to optimize shell
13 completion by avoiding module loading costs, monitor Maildirs
14 (and in the near future, IMAP folders) for changes.
15
16 =head2 worker processes
17
18 Most commands cause lei-daemon to L<fork(2)> new worker
19 processes to isolate and parallelize work.  lei-daemon is
20 significantly more aggressive than read-only
21 L<public-inbox-daemon(8)> processes with regards to resource use
22 since it's not designed to support C10K/C100K scenarios.
23
24 =head2 file descriptor passing
25
26 FD passing is used to reduce IPC costs for bulk I/O when
27 importing large mboxes from stdin and dumping large mboxes
28 to stdout.
29
30 =head2 SOCK_SEQPACKET
31
32 SOCK_SEQPACKET sockets are used for both communicating with
33 L<lei(1)> and to internal workers.  SOCK_SEQPACKET guarantees
34 reliability (unlike SOCK_DGRAM), allows easy load distribution,
35 and saves developers the trouble of maintaining stream parsers.
36
37 =head2 file monitoring
38
39 Inotify or EVFILT_VNODE is used depending on the platform
40 to monitor Maildirs for changes and track keyword changes.
41
42 The listen socket (default: C<$XDG_RUNTIME_DIR/lei/5.seq.sock>)
43 is also monitored, and the daemon will automatically shutdown
44 if it is unlinked.
45
46 =head1 CONTACT
47
48 Feedback welcome via plain-text mail to L<mailto:meta@public-inbox.org>
49
50 The mail archives are hosted at L<https://public-inbox.org/meta/> and
51 L<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
52
53 =head1 COPYRIGHT
54
55 Copyright all contributors L<mailto:meta@public-inbox.org>
56
57 License: AGPL-3.0+ L<https://www.gnu.org/licenses/agpl-3.0.txt>
58
59 =head1 SEE ALSO
60
61 L<lei-overview(7)>, L<lei-daemon-kill(1)>, L<lei-daemon-pid(1)>