-
Notifications
You must be signed in to change notification settings - Fork 77
/
mlm_client.api
234 lines (203 loc) · 9.77 KB
/
mlm_client.api
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!--
** WARNING *************************************************************
THIS SOURCE FILE IS 100% GENERATED. If you edit this file, you will lose
your changes at the next build cycle. This is great for temporary printf
statements. DO NOT MAKE ANY CHANGES YOU WISH TO KEEP. The correct places
for commits are:
* The XML model used for this code generation: mlm_client.xml, or
* The code generation script that built this file: zproto_client_c
************************************************************************
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of the Malamute Project.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<class name = "mlm_client">
Malamute Client
Codec class for mlm_client.
<constructor>
Create a new mlm_client, return the reference if successful,
or NULL if construction failed due to lack of available memory.
</constructor>
<destructor>
Destroy the mlm_client and free all memory used by the object.
</destructor>
<method name = "actor">
Return actor, when caller wants to work with multiple actors and/or
input sockets asynchronously.
<return type = "zactor" />
</method>
<method name = "msgpipe">
Return message pipe for asynchronous message I/O. In the high-volume case,
we send methods and get replies to the actor, in a synchronous manner, and
we send/recv high volume message data to a second pipe, the msgpipe. In
the low-volume case we can do everything over the actor pipe, if traffic
is never ambiguous.
<return type = "zsock" />
</method>
<method name = "connected">
Return true if client is currently connected, else false. Note that the
client will automatically re-connect if the server dies and restarts after
a successful first connection.
<return type = "boolean" />
</method>
<method name = "set plain auth">
Set PLAIN authentication username and password. If you do not call this, the
client will use NULL authentication. TODO: add "set curve auth".
Returns >= 0 if successful, -1 if interrupted.
<argument name = "username" type = "string"></argument>
<argument name = "password" type = "string"></argument>
<return type = "integer" />
</method>
<method name = "connect">
Connect to server endpoint, with specified timeout in msecs (zero means wait
forever). Constructor succeeds if connection is successful. The caller may
specify its address.
Returns >= 0 if successful, -1 if interrupted.
<argument name = "endpoint" type = "string">Endpoint to connect to</argument>
<argument name = "timeout" type = "number" size = "4">Timeout in msecs</argument>
<argument name = "address" type = "string">Unique address of caller, if any</argument>
<return type = "integer" />
</method>
<method name = "set producer">
Prepare to publish to a specified stream. After this, all messages are sent to
this stream exclusively.
Returns >= 0 if successful, -1 if interrupted.
<argument name = "stream" type = "string"></argument>
<return type = "integer" />
</method>
<method name = "set consumer">
Consume messages with matching subjects. The pattern is a regular expression
using the CZMQ zrex syntax. The most useful elements are: ^ and $ to match the
start and end, . to match any character, \s and \S to match whitespace and
non-whitespace, \d and \D to match a digit and non-digit, \a and \A to match
alphabetic and non-alphabetic, \w and \W to match alphanumeric and
non-alphanumeric, + for one or more repetitions, * for zero or more repetitions,
and ( ) to create groups. Returns 0 if subscription was successful, else -1.
Returns >= 0 if successful, -1 if interrupted.
<argument name = "stream" type = "string"></argument>
<argument name = "pattern" type = "string"></argument>
<return type = "integer" />
</method>
<method name = "remove consumer">
Remove all subscriptions to a stream
Returns >= 0 if successful, -1 if interrupted.
<argument name = "stream" type = "string"></argument>
<return type = "integer" />
</method>
<method name = "set worker">
Offer a particular named service, where the pattern matches request subjects
using the CZMQ zrex syntax.
Returns >= 0 if successful, -1 if interrupted.
<argument name = "address" type = "string"></argument>
<argument name = "pattern" type = "string"></argument>
<return type = "integer" />
</method>
<method name = "send">
Send STREAM SEND message to server, takes ownership of message
and destroys message when done sending it.
<argument name = "subject" type = "string">Message subject</argument>
<argument name = "content" type = "zmsg" by_reference = "1">Message body frames</argument>
<return type = "integer" />
</method>
<method name = "sendto">
Send MAILBOX SEND message to server, takes ownership of message
and destroys message when done sending it.
<argument name = "address" type = "string">Mailbox address</argument>
<argument name = "subject" type = "string">Message subject</argument>
<argument name = "tracker" type = "string">Message tracker</argument>
<argument name = "timeout" type = "number" size = "4">Timeout, msecs, or zero</argument>
<argument name = "content" type = "zmsg" by_reference = "1">Message body frames</argument>
<return type = "integer" />
</method>
<method name = "sendfor">
Send SERVICE SEND message to server, takes ownership of message
and destroys message when done sending it.
<argument name = "address" type = "string">Service address</argument>
<argument name = "subject" type = "string">Message subject</argument>
<argument name = "tracker" type = "string">Message tracker</argument>
<argument name = "timeout" type = "number" size = "4">Timeout, msecs, or zero</argument>
<argument name = "content" type = "zmsg" by_reference = "1">Message body frames</argument>
<return type = "integer" />
</method>
<method name = "recv">
Receive message from server; caller destroys message when done
<return type = "zmsg" fresh = "1" />
</method>
<method name = "command">
Return last received command. Can be one of these values:
"STREAM DELIVER"
"MAILBOX DELIVER"
"SERVICE DELIVER"
<return type = "string" />
</method>
<method name = "status">
Return last received status
<return type = "integer" />
</method>
<method name = "reason">
Return last received reason
<return type = "string" />
</method>
<method name = "address">
Return last received address
<return type = "string" />
</method>
<method name = "sender">
Return last received sender
<return type = "string" />
</method>
<method name = "subject">
Return last received subject
<return type = "string" />
</method>
<method name = "content">
Return last received content
<return type = "zmsg" />
</method>
<method name = "tracker">
Return last received tracker
<return type = "string" />
</method>
<!-- This is the API definition for custom code -->
<method name = "sendx">
Send multipart string message to stream, end list with NULL
Returns 0 if OK, -1 if failed due to lack of memory or other error.
<argument name = "subject" type = "string" />
<argument name = "content" type = "string" variadic = "1" />
<return type = "integer" />
</method>
<method name = "sendtox">
Send multipart string to mailbox, end list with NULL
Returns 0 if OK, -1 if failed due to lack of memory or other error.
<argument name = "address" type = "string" />
<argument name = "subject" type = "string" />
<argument name = "content" type = "string" variadic = "1" />
<return type = "integer" />
</method>
<method name = "sendforx">
Send multipart string to service, end list with NULL
Returns 0 if OK, -1 if failed due to lack of memory or other error.
<argument name = "address" type = "string" />
<argument name = "subject" type = "string" />
<argument name = "content" type = "string" variadic = "1" />
<return type = "integer" />
</method>
<method name = "recvx">
Receive a subject and string content from the server. The content may be
1 or more string frames. This method is orthogonal to the sendx methods.
End the string arguments with NULL. If there are not enough frames in
the received message, remaining strings are set to NULL. Returns number
of string contents received, or -1 in case of error. Free the returned
subject and content strings when finished with them. To get the type of
the command, use mlm_client_command ().
<argument name = "subject_p" type = "string" by_reference = "1" />
<argument name = "string_p" type = "string" by_reference = "1" variadic = "1" />
<return type = "integer" />
</method>
<method name = "set verbose">
Enable verbose tracing (animation) of state machine activity.
<argument name = "verbose" type = "boolean" />
</method>
</class>