1xpamb(1) SAORD Documentation xpamb(1)
2
3
4
6 xpamb: the XPA Message Bus
7
9 The xpamb program can act as a "classical" message bus interface
10 between clients and servers. A client can send a data request to the
11 message bus, which then interfaces with multiple servers and returns
12 the data back to the client.
13
15 For xpaset, several optional switches are used to save data and manipu‐
16 late the stored data:
17
18 · -data [name]
19
20 Add the supplied data buffer to a pool of stored data buffers,
21 using the specified name as a unique identifier for later
22 retrieval. An error occurs if the name already exists (use either
23 replace or del to rectify this). The -add switch is supported for
24 backwards compatibility with xpa 2.0.
25
26 · -replace [name]
27
28 Replace previously existing stored data having the same unique name
29 with new data. This essentially is a combination of the del and
30 data commands.
31
32 · -info ["'info string'"]
33
34 When adding a data buffer, you can specify an informational string
35 to be stored with that data. This string will be returned by
36 xpaget:
37
38 xpaget xpamb foo -info
39
40 (along with other information such as the date/time of storage and
41 the size of the data buffer) if the -info switch is specified. If
42 the info string contains spaces, you must enclose it in two sets of
43 quotes:
44
45 cat foo ⎪ xpaset xpamb -store foo -info "'this is info on foo'"
46
47 The first set of quotes is removed by the shell while the second is
48 used to delineate the info string.
49
50 · -send [name]
51
52 Broadcast the stored data buffer to the named template.
53
54 · -del [name]
55
56 Delete the named data buffer and free all allocated space.
57
58 Switches can be used in any combination that makes sense. For example:
59
60 cat foo.fits ⎪ xpaset xpamb -store foo -info "FITS" "DS9:*" fits foo.fits
61
62 will broadcast the foo.fits image to all access points of class DS9.
63 In addition, the foo.fits file will be stored under the name of foo for
64 later manipulation such as:
65
66 xpaset -p xpamb -send foo "DS9:*" fits foo.fits
67
68 will re-broadcast the foo.fits image to all access points of class
69 "DS9".
70
72 A "classical" message bus (such as ToolTalk) consists of servers and
73 clients, along with a mediating program that transfers data between
74 different processes. XPA takes a slightly different approach in that
75 communication between clients and servers is direct. This generally is
76 the correct technique when there is only one connection (or even a
77 small number of connections), but can become inefficient for the serv‐
78 ing program if a large amount of data is being transferred to many
79 clients. For example, if a real-time data acquisition program is broad‐
80 casting a FITS image to several clients, it would need to transmit that
81 image to each client individually. This might interfere with its own
82 processing cycles. The preferable mechanism would be to pass the image
83 off to an intermediate program that can then broadcast the data to the
84 several clients.
85
86 The xpamb program can alleviate such problems by functioning as a mes‐
87 sage bus in cases where such an intermediary process is wanted. It
88 pre-defines a single access point named XPAMB:xpamb to which data can
89 be sent for re-broadcast. You also can tell xpamb to save the data, and
90 associate with that data a new access point, so that it can be
91 retrieved later on.
92
93 All interaction with xpamb is performed through xpaset and xpaget (or
94 the corresponding API routines, XPASet() and XPAGet()) to the
95 XPAMB:xpamb access point. That is, xpamb is just another XPA-enabled
96 program that responds to requests from clients. The paramlist is used
97 to specify the targets to which the data will be for re-broadcast, as
98 well as the re-broadcast paramlist:
99
100 data ⎪ xpaset xpamb [switches] broadcast-target broadcast-paramlist
101
102 Optional switches are used to store data, and manipulate stored data,
103 and are described below.
104
105 In its simplest form, you can, for example, send a FITS image to xpamb
106 for broadcasting to all ds9 image simply by executing:
107
108 cat foo.fits ⎪ xpaset xpamb "DS9:*" fits foo.fits
109
110 Since DS9 is the class name for the ds9 image display program, this
111 will result in the FITS image being re-sent to all fits access points
112 for all active image display programs.
113
114 You can send stored data and new data to the same set of access points
115 at the same time. The stored data always is send first, followed by
116 the new data:
117
118 cat foo2.fits ⎪ xpaset xpamb -send foo "DS9:*" fits foo.fits
119
120 will first send the foo.fits file, and then the foo2.fits file to all
121 access points of class DS9. Notice that in this example, the foo2.fits
122 file is not stored, but it could be stored by using the -store [name]
123 switch on the command line.
124
125 The xpaget command can be used to retrieve a data from XPA access
126 points or from a stored data buffer, or retrieve information about a
127 stored data buffer. If no arguments are given:
128
129 xpaget xpamb
130
131 then information about all currently stored data buffers is returned.
132 This information includes the data and time at which the data was
133 stored, the size in bytes of the data, and the supplied info string.
134
135 If arguments are specified, they will be in the form:
136
137 xpaget xpamb [-info] [-data] [name [paramlist]]
138
139 If the optional -info and/or -data switches are specified, then infor‐
140 mation and/or data will be returned for the named data buffer following
141 the switches. You can use either or both of these switches in a single
142 command. For example, if the -info switch is used:
143
144 xpaget xpamb -info foo
145
146 then the info about that stored data buffer will be returned. If the
147 -data is used with a specific name:
148
149 xpaget xpamb -data foo
150
151 then the stored data itself will be returned. If both are used:
152
153 xpaget xpamb -info -data foo
154
155 then the info will be returned, followed by the data. Note that it is
156 an error to specify one of these switches without a data buffer name
157 and that the paramlist will be ignored.
158
159 If neither the -info or -data switch is specified, then the name refers
160 to an XPA access point (with an optional paramlist following). For
161 example:
162
163 xpaget xpamb ds9 file
164
165 is equivalent to:
166
167 xpaget ds9 file
168
170 See xpa(n) for a list of XPA help pages
171
172
173
174version 2.1.12 January 26, 2010 xpamb(1)