This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxump_store.icl
123 lines (107 loc) · 4.18 KB
/
xump_store.icl
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
<?xml?>
<!--
Copyright (c) 1996-2009 iMatix Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
For information on alternative licensing for OEMs, please contact
iMatix Corporation.
-->
<class
name = "xump_store"
comment = "Xump store portal"
script = "icl_gen"
>
<doc>
This class enables the creation of store back-ends. Store back-ends
are synchronous classes that implement the request methods defined here.
Store extensions may be internally multithreaded (i.e. pass requests to
internally asynchronous objects) but that is invisible to the calling
application.
</doc>
<inherit class = "ipr_portal">
<option name = "front_end" value = "sync" />
<option name = "back_end" value = "sync" />
</inherit>
<import class = "xump" />
<context>
<property name = "name" type = "char *" readonly = "1" />
</context>
<data>
<request name = "announce">
<field name = "opening" type = "Bool">Or, closing</field>
</request>
<request name = "queue create">
<doc>
Creates a new queue in the store. If the name is null, generates a
queue name. The queue may already exist. Constructs a xump_queue_t
object, if successful. Returns 0 if OK, -1 if the request failed.
</doc>
<field name = "queue_p" type = "xump_queue_t **" />
<field name = "queue name" type = "char *" />
</request>
<request name = "queue fetch">
<doc>
Fetches a queue from the store, by name. The queue must exist.
Constructs a new xump_queue_t object, if successful. Returns 0 if
OK, -1 if the request failed.
</doc>
<field name = "queue_p" type = "xump_queue_t **" />
<field name = "queue name" type = "char *" />
</request>
<request name = "queue delete">
<doc>
Deletes a queue in the store. The caller must already have fetched
or created the queue. Returns 0 if OK, -1 if the request failed. The
queue does not need to exist - delete is idempotent.
</doc>
<field name = "queue" type = "xump_queue_t *" />
</request>
<request name = "message create">
<doc>
Creates a new message in the queue. Constructs a xump_message_t
object for the caller. Returns 0 if OK, -1 if the request failed.
</doc>
<field name = "queue" type = "xump_queue_t *" />
<field name = "message_p" type = "xump_message_t **" />
<field name = "address" type = "char *" />
<field name = "headers" type = "xump_headers_t *" />
<field name = "body data" type = "void *" />
<field name = "body size" type = "size_t" />
</request>
<request name = "message fetch">
<doc>
Fetches a message from the queue. Constructs a xump_message_t
object for the caller. Returns 0 if OK, -1 if the request failed.
Index is offset from the head of the queue.
</doc>
<field name = "queue" type = "xump_queue_t *" />
<field name = "message_p" type = "xump_message_t **" />
<field name = "index" type = "size_t" />
</request>
<request name = "message delete">
<doc>
Deletes a message from the queue. The caller must already have
fetched or created the message. Returns 0 if OK, -1 if the request
failed. The message does not need to exist - delete is idempotent.
</doc>
<field name = "message" type = "xump_message_t *" />
</request>
</data>
<method name = "new">
<doc>
Creates a new store instance object.
</doc>
<argument name = "name" type = "char *" />
//
self->name = icl_mem_strdup (name);
</method>
<method name = "destroy">
icl_mem_free (self->name);
</method>
</class>