aboutsummaryrefslogtreecommitdiff
path: root/man/man4/plumber.html
blob: 83e5943f703ac8973e05dae9113827229dc98ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<head>
<title>plumber(4) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>PLUMBER(4)</b><td align=right><b>PLUMBER(4)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    plumber &ndash; file system for interprocess messaging<br>
    
</table>
<p><font size=+1><b>SYNOPSIS     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>plumber</font></tt> [ <tt><font size=+1>&#8722;p</font></tt> <i>plumbing</i> ]<br>
    
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    The <i>plumber</i> is a user-level file server that receives, examines,
    rewrites, and dispatches <a href="../man7/plumb.html"><i>plumb</i>(7)</a> messages between programs. Its
    behavior is programmed by a <i>plumbing</i> file (default <tt><font size=+1>$HOME/lib/plumbing</font></tt>)
    in the format of <a href="../man7/plumb.html"><i>plumb</i>(7)</a>. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    Its services are posted via <a href="../man4/9pserve.html"><i>9pserve</i>(4)</a> as <tt><font size=+1>plumb</font></tt>. and consist of
    two pre-defined files, <tt><font size=+1>plumb/send</font></tt> and <tt><font size=+1>plumb/rules</font></tt>, and a set of
    output <i>ports</i> for dispatching messages to applications. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    Programs use <tt><font size=+1>fswrite</font></tt> (see <a href="../man3/9pclient.html"><i>9pclient</i>(3)</a>) to deliver messages to
    the <tt><font size=+1>send</font></tt> file, and <i>fsread</i> to receive them from the corresponding
    port. For example, <a href="../man1/sam.html"><i>sam</i>(1)</a>&#8217;s <tt><font size=+1>plumb</font></tt> menu item or the <tt><font size=+1>B</font></tt> command cause
    a message to be sent to <tt><font size=+1>plumb/send</font></tt>; <tt><font size=+1>sam</font></tt> in turn reads from, by
    convention, <tt><font size=+1>plumb/edit</font></tt> to receive
    messages about files to open. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    A copy of each message is sent to each client that has the corresponding
    port open. If none has it open, and the rule has a <tt><font size=+1>plumb client</font></tt>
    or <tt><font size=+1>plumb start</font></tt> rule, that rule is applied. A <tt><font size=+1>plumb client</font></tt> rule
    causes the specified command to be run and the message to be held
    for delivery when the port is opened. A
    <tt><font size=+1>plumb start</font></tt> rule runs the command but discards the message. If
    neither <tt><font size=+1>start</font></tt> or <tt><font size=+1>client</font></tt> is specified and the port is not open,
    the message is discarded and a write error is returned to the
    sender. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The set of output ports is determined dynamically by the specification
    in the plumbing rules file: a port is created for each unique
    destination of a <tt><font size=+1>plumb to</font></tt> rule. 
    <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
    
    The set of rules currently active may be examined by reading the
    file <tt><font size=+1>plumb/rules</font></tt>; appending to this file adds new rules to the
    set, while creating it (opening it with <tt><font size=+1>OTRUNC</font></tt>) clears the rule
    set. Thus the rule set may be edited dynamically with a traditional
    text editor. However, ports are never deleted dynamically;
    if a new set of rules does not include a port that was defined
    in earlier rules, that port will still exist (although no new
    messages will be delivered there).<br>
    
</table>
<p><font size=+1><b>FILES     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>$HOME/lib/plumbing</font></tt>&nbsp;&nbsp;&nbsp;default rules file<br>
    <tt><font size=+1>/usr/local/plan9/plumb<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            directory to search for files in <tt><font size=+1>include</font></tt> statements<br>
            
        </table>
        
    </table>
    <tt><font size=+1>plumb</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mount name for <a href="../man4/plumber.html"><i>plumber</i>(4)</a>.<br>
    
</table>
<p><font size=+1><b>SOURCE     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <tt><font size=+1>/usr/local/plan9/src/cmd/plumb<br>
    </font></tt>
</table>
<p><font size=+1><b>SEE ALSO     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man1/plumb.html"><i>plumb</i>(1)</a>, <a href="../man3/plumb.html"><i>plumb</i>(3)</a>, <a href="../man7/plumb.html"><i>plumb</i>(7)</a><br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>