blob: 0dfe68bb8b727ef0433ba7f604b0c64a0b91374d [file] [log] [blame]
rsc058b0112005-01-03 06:40:20 +00001.TH PLUMBER 4
2.SH NAME
3plumber \- file system for interprocess messaging
4.SH SYNOPSIS
5.B plumber
6[
7.B -p
8.I plumbing
9]
10.SH DESCRIPTION
11The
12.I plumber
13is a user-level file server that receives, examines, rewrites, and dispatches
14.IR plumb (7)
15messages between programs.
16Its behavior is programmed by a
17.I plumbing
18file (default
rscc8b63422005-01-13 04:49:19 +000019.BR $HOME/lib/plumbing )
rsc058b0112005-01-03 06:40:20 +000020in the format of
21.IR plumb (7).
22.PP
23Its services are posted via
24.IR 9pserve (4)
25as
26.BR plumb .
27and consist of two
28pre-defined files,
29.B plumb/send
30and
31.BR plumb/rules ,
32and a set of output
33.I ports
34for dispatching messages to applications.
35.PP
36Programs use
37.B fswrite
38(see
39.IR 9pclient (3))
40to deliver messages to the
41.B send
42file, and
43.I fsread
44to receive them from the corresponding port.
45For example,
46.IR sam (1)'s
47.B plumb
48menu item or the
49.B B
50command cause a message to be sent to
51.BR plumb/send ;
52.B sam
53in turn reads from, by convention,
54.B plumb/edit
55to receive messages about files to open.
56.PP
57A copy of each message is sent to each client that has the corresponding port open.
58If none has it open, and the rule has a
59.B plumb
60.B client
61or
62.B plumb
63.B start
64rule, that rule is applied.
65A
66.B plumb
67.B client
68rule causes the specified command to be run
69and the message to be held for delivery when the port is opened.
70A
71.B plumb
72.B start
73rule runs the command but discards the message.
74If neither
75.B start
76or
77.B client
78is specified and the port is not open,
79the message is discarded and a write error is returned to the sender.
80.PP
81The set of output ports is determined dynamically by the
82specification in the plumbing rules file: a port is created for each unique
83destination of a
84.B plumb
85.B to
86rule.
87.PP
88The set of rules currently active may be examined by reading the file
89.BR plumb/rules ;
90appending to this file adds new rules to the set, while
91creating it (opening it with
92.BR OTRUNC )
93clears the rule set.
94Thus the rule set may be edited dynamically with a traditional text editor.
95However, ports are never deleted dynamically; if a new set of rules does not
96include a port that was defined in earlier rules, that port will still exist (although
97no new messages will be delivered there).
98.SH FILES
rscc8b63422005-01-13 04:49:19 +000099.TF $HOME/lib/plumbing
rsc058b0112005-01-03 06:40:20 +0000100.TP
rscc8b63422005-01-13 04:49:19 +0000101.B $HOME/lib/plumbing
rsc058b0112005-01-03 06:40:20 +0000102default rules file
103.TP
rscc3674de2005-01-11 17:37:33 +0000104.B \*9/plumb
rsc058b0112005-01-03 06:40:20 +0000105directory to search for files in
106.B include
107statements
108.TP
109.B plumb
110mount name for
111.IR plumber (4).
112.SH SOURCE
rscc3674de2005-01-11 17:37:33 +0000113.B \*9/src/cmd/plumb
rsc058b0112005-01-03 06:40:20 +0000114.SH "SEE ALSO"
115.IR plumb (1),
116.IR plumb (3),
117.IR plumb (7)
118.\" .SH BUGS
119.\" .IR Plumber 's
120.\" file name space is fixed, so it is difficult to plumb
121.\" messages that involve files in newly mounted services.