homeq 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +103 -0
- data/COPYING +348 -0
- data/README.rdoc +64 -0
- data/Rakefile +131 -0
- data/bin/hq +6 -0
- data/config/boot.rb +224 -0
- data/config/databases/frontbase.yml +28 -0
- data/config/databases/mysql.yml +54 -0
- data/config/databases/oracle.yml +39 -0
- data/config/databases/postgresql.yml +48 -0
- data/config/databases/sqlite2.yml +16 -0
- data/config/databases/sqlite3.yml +19 -0
- data/config/environment.rb +20 -0
- data/config/environments/development.cfg +35 -0
- data/config/environments/production.cfg +35 -0
- data/config/environments/test.cfg +35 -0
- data/config/generators/job/templates/job.rb.erb +20 -0
- data/config/generators/message/templates/messages/MESSAGE.proto.erb +12 -0
- data/config/generators/model/templates/models/MODEL.rb.erb +3 -0
- data/config/generators/service/templates/services/SERVICE.rb.erb +43 -0
- data/config/homeq.cfg +35 -0
- data/extras/consumer.rb +85 -0
- data/extras/homeq.cfg +49 -0
- data/extras/hqd.rb +33 -0
- data/extras/producer.rb +79 -0
- data/extras/simple_consumer.rb +53 -0
- data/lib/homeq/base/base.rb +44 -0
- data/lib/homeq/base/commando.rb +81 -0
- data/lib/homeq/base/config.rb +99 -0
- data/lib/homeq/base/exception.rb +48 -0
- data/lib/homeq/base/histogram.rb +141 -0
- data/lib/homeq/base/logger.rb +185 -0
- data/lib/homeq/base/ohash.rb +297 -0
- data/lib/homeq/base/options.rb +171 -0
- data/lib/homeq/base/poolable.rb +100 -0
- data/lib/homeq/base/system.rb +446 -0
- data/lib/homeq/cli.rb +35 -0
- data/lib/homeq/cp/commands.rb +71 -0
- data/lib/homeq/cp/connection.rb +97 -0
- data/lib/homeq/cp/cp.rb +30 -0
- data/lib/homeq/cp/server.rb +105 -0
- data/lib/homeq/sobs/client.rb +119 -0
- data/lib/homeq/sobs/connection.rb +635 -0
- data/lib/homeq/sobs/foreman.rb +237 -0
- data/lib/homeq/sobs/job.rb +66 -0
- data/lib/homeq/sobs/message.rb +49 -0
- data/lib/homeq/sobs/queue.rb +224 -0
- data/lib/homeq/sobs/sender.rb +150 -0
- data/lib/homeq/sobs/server.rb +654 -0
- data/lib/homeq/sobs/sobs.rb +45 -0
- data/lib/homeq/sobs/topology.rb +111 -0
- data/lib/homeq.rb +106 -0
- data/lib/tasks/Rakefile +49 -0
- data/lib/tasks/database.rake +387 -0
- data/lib/tasks/gem.rake +9 -0
- data/lib/tasks/generate.rake +192 -0
- data/lib/tasks/hq.rake +171 -0
- data/lib/tasks/testing.rake +95 -0
- data/lib/tasks/utility.rb +17 -0
- data/script/console.rb +45 -0
- data/script/generate +7 -0
- data/test/unittest.rb +51 -0
- metadata +222 -0
data/CHANGELOG
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
2008-08-28 00:33 colin
|
2
|
+
|
3
|
+
* COPYING, README, Rakefile, extras/hqd.rb, lib/base/base.rb,
|
4
|
+
lib/cp/cp.rb, lib/homeq.rb, lib/sobs/sobs.rb: Gemified, using
|
5
|
+
rake for common tasks.
|
6
|
+
|
7
|
+
2008-08-27 20:18 colin
|
8
|
+
|
9
|
+
* lib/homeq: Reorganized dir structure.
|
10
|
+
|
11
|
+
2008-08-27 20:15 colin
|
12
|
+
|
13
|
+
* CHANGELOG, COPYING, README, Rakefile, consumer.rb, extras,
|
14
|
+
extras/consumer.rb, extras/homeq.cfg, extras/hqd.rb,
|
15
|
+
extras/producer.rb, homeq.cfg, hqd.rb, lib, lib/README,
|
16
|
+
lib/base/base.rb, lib/base/config.rb, lib/base/exception.rb,
|
17
|
+
lib/base/logger.rb, lib/base/options.rb, lib/base/queue.rb,
|
18
|
+
lib/base/system.rb, lib/cp/commands.rb, lib/cp/connection.rb,
|
19
|
+
lib/cp/cp.rb, lib/cp/server.rb, lib/homeq, lib/homeq.rb,
|
20
|
+
lib/homeq/README, lib/homeq/base, lib/homeq/cp,
|
21
|
+
lib/homeq/homeq.rb, lib/homeq/sobs, lib/sobs/client.rb,
|
22
|
+
lib/sobs/connection.rb, lib/sobs/foreman.rb, lib/sobs/job.rb,
|
23
|
+
lib/sobs/message.rb, lib/sobs/queue.rb, lib/sobs/server.rb,
|
24
|
+
lib/sobs/sobs.rb, lib/sobs/topology.rb, producer.rb, test:
|
25
|
+
Reorganized dir structure.
|
26
|
+
|
27
|
+
2008-08-27 20:14 colin
|
28
|
+
|
29
|
+
* homeq: Reorganized dir structure.
|
30
|
+
|
31
|
+
2008-08-27 20:05 colin
|
32
|
+
|
33
|
+
* consumer.rb, homeq.cfg, homeq/README, homeq/base/logger.rb,
|
34
|
+
homeq/base/options.rb, homeq/base/system.rb,
|
35
|
+
homeq/sobs/client.rb, homeq/sobs/connection.rb,
|
36
|
+
homeq/sobs/foreman.rb, homeq/sobs/job.rb, homeq/sobs/queue.rb,
|
37
|
+
homeq/sobs/server.rb, producer.rb, sobsd.rb: Some bug fixing,
|
38
|
+
first "benchmark" done. ~1500 i+o/sec. Not bad.
|
39
|
+
|
40
|
+
2008-08-27 04:56 colin
|
41
|
+
|
42
|
+
* consumer.rb, homeq.cfg, homeq/README, homeq/Rakefile,
|
43
|
+
homeq/base/config.rb, homeq/base/exception.rb,
|
44
|
+
homeq/base/logger.rb, homeq/base/options.rb,
|
45
|
+
homeq/base/system.rb, homeq/cp/commands.rb,
|
46
|
+
homeq/cp/connection.rb, homeq/homeq.rb, homeq/sobs/client.rb,
|
47
|
+
homeq/sobs/connection.rb, homeq/sobs/foreman.rb,
|
48
|
+
homeq/sobs/queue.rb, homeq/sobs/server.rb,
|
49
|
+
homeq/sobs/topology.rb, homeq/test, homeq/test/client.cfg,
|
50
|
+
homeq/test/common.cfg, homeq/test/server.cfg, homeq/test/unit,
|
51
|
+
homeq/test/unit/first.rb, homeq/test/unittest.rb, hqd.rb,
|
52
|
+
producer.rb, sobsd.rb: Added test scaffolding, cleaned up bugs
|
53
|
+
and logic problems in sobs. Cleanup in config/option, better
|
54
|
+
abstraction for config from code.
|
55
|
+
|
56
|
+
2008-08-26 15:59 colin
|
57
|
+
|
58
|
+
* consumer.rb, homeq.cfg, homeq/README, homeq/base/base.rb,
|
59
|
+
homeq/base/config.rb, homeq/base/exception.rb,
|
60
|
+
homeq/base/logger.rb, homeq/base/options.rb,
|
61
|
+
homeq/base/system.rb, homeq/cp/commands.rb,
|
62
|
+
homeq/cp/connection.rb, homeq/cp/cp.rb, homeq/cp/server.rb,
|
63
|
+
homeq/homeq.rb, homeq/sobs/client.rb, homeq/sobs/connection.rb,
|
64
|
+
homeq/sobs/foreman.rb, homeq/sobs/job.rb, homeq/sobs/message.rb,
|
65
|
+
homeq/sobs/queue.rb, homeq/sobs/server.rb, homeq/sobs/sobs.rb,
|
66
|
+
homeq/sobs/topology.rb, producer.rb, prototype.cfg, server.rb,
|
67
|
+
sobsd.rb, start_server.rb, test.rb: Fixed logic error not issuing
|
68
|
+
a 'reserved' to a connection with an outstanding 'reserve' with
|
69
|
+
an empty work queue, when it sends a 'put'. Fixed parsing error
|
70
|
+
for 'deadline_soon'. Added keywords and headers, README.
|
71
|
+
|
72
|
+
2008-08-26 00:55 colin
|
73
|
+
|
74
|
+
* homeq/base/base.rb, homeq/base/exception.rb,
|
75
|
+
homeq/base/options.rb, homeq/base/queue.rb, homeq/base/system.rb,
|
76
|
+
homeq/cp/server.rb, homeq/sobs/client.rb,
|
77
|
+
homeq/sobs/connection.rb, homeq/sobs/foreman.rb,
|
78
|
+
homeq/sobs/queue.rb, homeq/sobs/server.rb, homeq/sobs/sobs.rb,
|
79
|
+
homeq/sobs/topology.rb, prototype.cfg, sobsd.rb, test.rb: About
|
80
|
+
to restart development.
|
81
|
+
|
82
|
+
2008-08-12 01:29 colin
|
83
|
+
|
84
|
+
* homeq/base/base.rb, homeq/base/config.rb, homeq/base/options.rb,
|
85
|
+
homeq/base/system.rb, homeq/sobs/client.rb,
|
86
|
+
homeq/sobs/connection.rb, homeq/sobs/queue.rb,
|
87
|
+
homeq/sobs/server.rb, homeq/sobs/sobs.rb, homeq/sobs/topology.rb,
|
88
|
+
prototype.cfg: Refactored state machine into connection class,
|
89
|
+
added options and topology.
|
90
|
+
|
91
|
+
2008-08-08 01:29 colin
|
92
|
+
|
93
|
+
* ., consumer.rb, homeq, homeq/README, homeq/base,
|
94
|
+
homeq/base/base.rb, homeq/base/config.rb,
|
95
|
+
homeq/base/exception.rb, homeq/base/logger.rb,
|
96
|
+
homeq/base/queue.rb, homeq/base/system.rb, homeq/cp,
|
97
|
+
homeq/cp/commands.rb, homeq/cp/connection.rb, homeq/cp/cp.rb,
|
98
|
+
homeq/cp/server.rb, homeq/homeq.rb, homeq/sobs,
|
99
|
+
homeq/sobs/client.rb, homeq/sobs/connection.rb,
|
100
|
+
homeq/sobs/job.rb, homeq/sobs/message.rb, homeq/sobs/server.rb,
|
101
|
+
homeq/sobs/sobs.rb, producer.rb, prototype.cfg, server.rb,
|
102
|
+
sobsd.rb, start_server.rb, test.rb: Initial import.
|
103
|
+
|
data/COPYING
ADDED
@@ -0,0 +1,348 @@
|
|
1
|
+
Ruby Home Queue (HomeQ)
|
2
|
+
|
3
|
+
Copyright (c) 2008 Colin Steele
|
4
|
+
|
5
|
+
|
6
|
+
THE RUBY LICENSE
|
7
|
+
(http://www.ruby-lang.org/en/LICENSE.txt)
|
8
|
+
|
9
|
+
You may redistribute this software and/or modify it under either the terms of
|
10
|
+
the GPL (see below), or the conditions below:
|
11
|
+
|
12
|
+
1. You may make and give away verbatim copies of the source form of the
|
13
|
+
software without restriction, provided that you duplicate all of the
|
14
|
+
original copyright notices and associated disclaimers.
|
15
|
+
|
16
|
+
2. You may modify your copy of the software in any way, provided that
|
17
|
+
you do at least ONE of the following:
|
18
|
+
|
19
|
+
a) place your modifications in the Public Domain or otherwise
|
20
|
+
make them Freely Available, such as by posting said
|
21
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
22
|
+
the author to include your modifications in the software.
|
23
|
+
|
24
|
+
b) use the modified software only within your corporation or
|
25
|
+
organization.
|
26
|
+
|
27
|
+
c) rename any non-standard executables so the names do not conflict
|
28
|
+
with standard executables, which must also be provided.
|
29
|
+
|
30
|
+
d) make other distribution arrangements with the author.
|
31
|
+
|
32
|
+
3. You may distribute the software in object code or executable
|
33
|
+
form, provided that you do at least ONE of the following:
|
34
|
+
|
35
|
+
a) distribute the executables and library files of the software,
|
36
|
+
together with instructions (in the manual page or equivalent)
|
37
|
+
on where to get the original distribution.
|
38
|
+
|
39
|
+
b) accompany the distribution with the machine-readable source of
|
40
|
+
the software.
|
41
|
+
|
42
|
+
c) give non-standard executables non-standard names, with
|
43
|
+
instructions on where to get the original software distribution.
|
44
|
+
|
45
|
+
d) make other distribution arrangements with the author.
|
46
|
+
|
47
|
+
4. You may modify and include the part of the software into any other
|
48
|
+
software (possibly commercial). But some files in the distribution
|
49
|
+
are not written by the author, so that they are not under these terms.
|
50
|
+
|
51
|
+
For the list of those files and their copying conditions, see the
|
52
|
+
file LEGAL.
|
53
|
+
|
54
|
+
5. The scripts and library files supplied as input to or produced as
|
55
|
+
output from the software do not automatically fall under the
|
56
|
+
copyright of the software, but belong to whomever generated them,
|
57
|
+
and may be sold commercially, and may be aggregated with this
|
58
|
+
software.
|
59
|
+
|
60
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
61
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
62
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
63
|
+
PURPOSE.
|
64
|
+
|
65
|
+
----------------------------------------------------------------------------
|
66
|
+
|
67
|
+
|
68
|
+
GNU GENERAL PUBLIC LICENSE
|
69
|
+
Version 2, June 1991
|
70
|
+
|
71
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
72
|
+
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
73
|
+
Everyone is permitted to copy and distribute verbatim copies
|
74
|
+
of this license document, but changing it is not allowed.
|
75
|
+
|
76
|
+
Preamble
|
77
|
+
|
78
|
+
The licenses for most software are designed to take away your
|
79
|
+
freedom to share and change it. By contrast, the GNU General Public
|
80
|
+
License is intended to guarantee your freedom to share and change free
|
81
|
+
software--to make sure the software is free for all its users. This
|
82
|
+
General Public License applies to most of the Free Software
|
83
|
+
Foundation's software and to any other program whose authors commit to
|
84
|
+
using it. (Some other Free Software Foundation software is covered by
|
85
|
+
the GNU Library General Public License instead.) You can apply it to
|
86
|
+
your programs, too.
|
87
|
+
|
88
|
+
When we speak of free software, we are referring to freedom, not
|
89
|
+
price. Our General Public Licenses are designed to make sure that you
|
90
|
+
have the freedom to distribute copies of free software (and charge for
|
91
|
+
this service if you wish), that you receive source code or can get it
|
92
|
+
if you want it, that you can change the software or use pieces of it
|
93
|
+
in new free programs; and that you know you can do these things.
|
94
|
+
|
95
|
+
To protect your rights, we need to make restrictions that forbid
|
96
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
97
|
+
These restrictions translate to certain responsibilities for you if you
|
98
|
+
distribute copies of the software, or if you modify it.
|
99
|
+
|
100
|
+
For example, if you distribute copies of such a program, whether
|
101
|
+
gratis or for a fee, you must give the recipients all the rights that
|
102
|
+
you have. You must make sure that they, too, receive or can get the
|
103
|
+
source code. And you must show them these terms so they know their
|
104
|
+
rights.
|
105
|
+
|
106
|
+
We protect your rights with two steps: (1) copyright the software, and
|
107
|
+
(2) offer you this license which gives you legal permission to copy,
|
108
|
+
distribute and/or modify the software.
|
109
|
+
|
110
|
+
Also, for each author's protection and ours, we want to make certain
|
111
|
+
that everyone understands that there is no warranty for this free
|
112
|
+
software. If the software is modified by someone else and passed on, we
|
113
|
+
want its recipients to know that what they have is not the original, so
|
114
|
+
that any problems introduced by others will not reflect on the original
|
115
|
+
authors' reputations.
|
116
|
+
|
117
|
+
Finally, any free program is threatened constantly by software
|
118
|
+
patents. We wish to avoid the danger that redistributors of a free
|
119
|
+
program will individually obtain patent licenses, in effect making the
|
120
|
+
program proprietary. To prevent this, we have made it clear that any
|
121
|
+
patent must be licensed for everyone's free use or not licensed at all.
|
122
|
+
|
123
|
+
The precise terms and conditions for copying, distribution and
|
124
|
+
modification follow.
|
125
|
+
|
126
|
+
GNU GENERAL PUBLIC LICENSE
|
127
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
128
|
+
|
129
|
+
0. This License applies to any program or other work which contains
|
130
|
+
a notice placed by the copyright holder saying it may be distributed
|
131
|
+
under the terms of this General Public License. The "Program", below,
|
132
|
+
refers to any such program or work, and a "work based on the Program"
|
133
|
+
means either the Program or any derivative work under copyright law:
|
134
|
+
that is to say, a work containing the Program or a portion of it,
|
135
|
+
either verbatim or with modifications and/or translated into another
|
136
|
+
language. (Hereinafter, translation is included without limitation in
|
137
|
+
the term "modification".) Each licensee is addressed as "you".
|
138
|
+
|
139
|
+
Activities other than copying, distribution and modification are not
|
140
|
+
covered by this License; they are outside its scope. The act of
|
141
|
+
running the Program is not restricted, and the output from the Program
|
142
|
+
is covered only if its contents constitute a work based on the
|
143
|
+
Program (independent of having been made by running the Program).
|
144
|
+
Whether that is true depends on what the Program does.
|
145
|
+
|
146
|
+
1. You may copy and distribute verbatim copies of the Program's
|
147
|
+
source code as you receive it, in any medium, provided that you
|
148
|
+
conspicuously and appropriately publish on each copy an appropriate
|
149
|
+
copyright notice and disclaimer of warranty; keep intact all the
|
150
|
+
notices that refer to this License and to the absence of any warranty;
|
151
|
+
and give any other recipients of the Program a copy of this License
|
152
|
+
along with the Program.
|
153
|
+
|
154
|
+
You may charge a fee for the physical act of transferring a copy, and
|
155
|
+
you may at your option offer warranty protection in exchange for a fee.
|
156
|
+
|
157
|
+
2. You may modify your copy or copies of the Program or any portion
|
158
|
+
of it, thus forming a work based on the Program, and copy and
|
159
|
+
distribute such modifications or work under the terms of Section 1
|
160
|
+
above, provided that you also meet all of these conditions:
|
161
|
+
|
162
|
+
a) You must cause the modified files to carry prominent notices
|
163
|
+
stating that you changed the files and the date of any change.
|
164
|
+
|
165
|
+
b) You must cause any work that you distribute or publish, that in
|
166
|
+
whole or in part contains or is derived from the Program or any
|
167
|
+
part thereof, to be licensed as a whole at no charge to all third
|
168
|
+
parties under the terms of this License.
|
169
|
+
|
170
|
+
c) If the modified program normally reads commands interactively
|
171
|
+
when run, you must cause it, when started running for such
|
172
|
+
interactive use in the most ordinary way, to print or display an
|
173
|
+
announcement including an appropriate copyright notice and a
|
174
|
+
notice that there is no warranty (or else, saying that you provide
|
175
|
+
a warranty) and that users may redistribute the program under
|
176
|
+
these conditions, and telling the user how to view a copy of this
|
177
|
+
License. (Exception: if the Program itself is interactive but
|
178
|
+
does not normally print such an announcement, your work based on
|
179
|
+
the Program is not required to print an announcement.)
|
180
|
+
|
181
|
+
These requirements apply to the modified work as a whole. If
|
182
|
+
identifiable sections of that work are not derived from the Program,
|
183
|
+
and can be reasonably considered independent and separate works in
|
184
|
+
themselves, then this License, and its terms, do not apply to those
|
185
|
+
sections when you distribute them as separate works. But when you
|
186
|
+
distribute the same sections as part of a whole which is a work based
|
187
|
+
on the Program, the distribution of the whole must be on the terms of
|
188
|
+
this License, whose permissions for other licensees extend to the
|
189
|
+
entire whole, and thus to each and every part regardless of who wrote it.
|
190
|
+
|
191
|
+
Thus, it is not the intent of this section to claim rights or contest
|
192
|
+
your rights to work written entirely by you; rather, the intent is to
|
193
|
+
exercise the right to control the distribution of derivative or
|
194
|
+
collective works based on the Program.
|
195
|
+
|
196
|
+
In addition, mere aggregation of another work not based on the Program
|
197
|
+
with the Program (or with a work based on the Program) on a volume of
|
198
|
+
a storage or distribution medium does not bring the other work under
|
199
|
+
the scope of this License.
|
200
|
+
|
201
|
+
3. You may copy and distribute the Program (or a work based on it,
|
202
|
+
under Section 2) in object code or executable form under the terms of
|
203
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
204
|
+
|
205
|
+
a) Accompany it with the complete corresponding machine-readable
|
206
|
+
source code, which must be distributed under the terms of Sections
|
207
|
+
1 and 2 above on a medium customarily used for software interchange; or,
|
208
|
+
|
209
|
+
b) Accompany it with a written offer, valid for at least three
|
210
|
+
years, to give any third party, for a charge no more than your
|
211
|
+
cost of physically performing source distribution, a complete
|
212
|
+
machine-readable copy of the corresponding source code, to be
|
213
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
214
|
+
customarily used for software interchange; or,
|
215
|
+
|
216
|
+
c) Accompany it with the information you received as to the offer
|
217
|
+
to distribute corresponding source code. (This alternative is
|
218
|
+
allowed only for noncommercial distribution and only if you
|
219
|
+
received the program in object code or executable form with such
|
220
|
+
an offer, in accord with Subsection b above.)
|
221
|
+
|
222
|
+
The source code for a work means the preferred form of the work for
|
223
|
+
making modifications to it. For an executable work, complete source
|
224
|
+
code means all the source code for all modules it contains, plus any
|
225
|
+
associated interface definition files, plus the scripts used to
|
226
|
+
control compilation and installation of the executable. However, as a
|
227
|
+
special exception, the source code distributed need not include
|
228
|
+
anything that is normally distributed (in either source or binary
|
229
|
+
form) with the major components (compiler, kernel, and so on) of the
|
230
|
+
operating system on which the executable runs, unless that component
|
231
|
+
itself accompanies the executable.
|
232
|
+
|
233
|
+
If distribution of executable or object code is made by offering
|
234
|
+
access to copy from a designated place, then offering equivalent
|
235
|
+
access to copy the source code from the same place counts as
|
236
|
+
distribution of the source code, even though third parties are not
|
237
|
+
compelled to copy the source along with the object code.
|
238
|
+
|
239
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
240
|
+
except as expressly provided under this License. Any attempt
|
241
|
+
otherwise to copy, modify, sublicense or distribute the Program is
|
242
|
+
void, and will automatically terminate your rights under this License.
|
243
|
+
However, parties who have received copies, or rights, from you under
|
244
|
+
this License will not have their licenses terminated so long as such
|
245
|
+
parties remain in full compliance.
|
246
|
+
|
247
|
+
5. You are not required to accept this License, since you have not
|
248
|
+
signed it. However, nothing else grants you permission to modify or
|
249
|
+
distribute the Program or its derivative works. These actions are
|
250
|
+
prohibited by law if you do not accept this License. Therefore, by
|
251
|
+
modifying or distributing the Program (or any work based on the
|
252
|
+
Program), you indicate your acceptance of this License to do so, and
|
253
|
+
all its terms and conditions for copying, distributing or modifying
|
254
|
+
the Program or works based on it.
|
255
|
+
|
256
|
+
6. Each time you redistribute the Program (or any work based on the
|
257
|
+
Program), the recipient automatically receives a license from the
|
258
|
+
original licensor to copy, distribute or modify the Program subject to
|
259
|
+
these terms and conditions. You may not impose any further
|
260
|
+
restrictions on the recipients' exercise of the rights granted herein.
|
261
|
+
You are not responsible for enforcing compliance by third parties to
|
262
|
+
this License.
|
263
|
+
|
264
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
265
|
+
infringement or for any other reason (not limited to patent issues),
|
266
|
+
conditions are imposed on you (whether by court order, agreement or
|
267
|
+
otherwise) that contradict the conditions of this License, they do not
|
268
|
+
excuse you from the conditions of this License. If you cannot
|
269
|
+
distribute so as to satisfy simultaneously your obligations under this
|
270
|
+
License and any other pertinent obligations, then as a consequence you
|
271
|
+
may not distribute the Program at all. For example, if a patent
|
272
|
+
license would not permit royalty-free redistribution of the Program by
|
273
|
+
all those who receive copies directly or indirectly through you, then
|
274
|
+
the only way you could satisfy both it and this License would be to
|
275
|
+
refrain entirely from distribution of the Program.
|
276
|
+
|
277
|
+
If any portion of this section is held invalid or unenforceable under
|
278
|
+
any particular circumstance, the balance of the section is intended to
|
279
|
+
apply and the section as a whole is intended to apply in other
|
280
|
+
circumstances.
|
281
|
+
|
282
|
+
It is not the purpose of this section to induce you to infringe any
|
283
|
+
patents or other property right claims or to contest validity of any
|
284
|
+
such claims; this section has the sole purpose of protecting the
|
285
|
+
integrity of the free software distribution system, which is
|
286
|
+
implemented by public license practices. Many people have made
|
287
|
+
generous contributions to the wide range of software distributed
|
288
|
+
through that system in reliance on consistent application of that
|
289
|
+
system; it is up to the author/donor to decide if he or she is willing
|
290
|
+
to distribute software through any other system and a licensee cannot
|
291
|
+
impose that choice.
|
292
|
+
|
293
|
+
This section is intended to make thoroughly clear what is believed to
|
294
|
+
be a consequence of the rest of this License.
|
295
|
+
|
296
|
+
8. If the distribution and/or use of the Program is restricted in
|
297
|
+
certain countries either by patents or by copyrighted interfaces, the
|
298
|
+
original copyright holder who places the Program under this License
|
299
|
+
may add an explicit geographical distribution limitation excluding
|
300
|
+
those countries, so that distribution is permitted only in or among
|
301
|
+
countries not thus excluded. In such case, this License incorporates
|
302
|
+
the limitation as if written in the body of this License.
|
303
|
+
|
304
|
+
9. The Free Software Foundation may publish revised and/or new versions
|
305
|
+
of the General Public License from time to time. Such new versions will
|
306
|
+
be similar in spirit to the present version, but may differ in detail to
|
307
|
+
address new problems or concerns.
|
308
|
+
|
309
|
+
Each version is given a distinguishing version number. If the Program
|
310
|
+
specifies a version number of this License which applies to it and "any
|
311
|
+
later version", you have the option of following the terms and conditions
|
312
|
+
either of that version or of any later version published by the Free
|
313
|
+
Software Foundation. If the Program does not specify a version number of
|
314
|
+
this License, you may choose any version ever published by the Free Software
|
315
|
+
Foundation.
|
316
|
+
|
317
|
+
10. If you wish to incorporate parts of the Program into other free
|
318
|
+
programs whose distribution conditions are different, write to the author
|
319
|
+
to ask for permission. For software which is copyrighted by the Free
|
320
|
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
321
|
+
make exceptions for this. Our decision will be guided by the two goals
|
322
|
+
of preserving the free status of all derivatives of our free software and
|
323
|
+
of promoting the sharing and reuse of software generally.
|
324
|
+
|
325
|
+
NO WARRANTY
|
326
|
+
|
327
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
328
|
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
329
|
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
330
|
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
331
|
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
332
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
333
|
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
334
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
335
|
+
REPAIR OR CORRECTION.
|
336
|
+
|
337
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
338
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
339
|
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
340
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
341
|
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
342
|
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
343
|
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
344
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
345
|
+
POSSIBILITY OF SUCH DAMAGES.
|
346
|
+
|
347
|
+
END OF TERMS AND CONDITIONS
|
348
|
+
|
data/README.rdoc
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
= INTRODUCTION
|
2
|
+
|
3
|
+
From http://en.wikipedia.org/wiki/Message_queue:
|
4
|
+
|
5
|
+
Message queues provide an asynchronous communications protocol,
|
6
|
+
meaning that the sender and receiver of the message do not need
|
7
|
+
to interact with the message queue at the same time. Messages
|
8
|
+
placed onto the queue are stored until the recipient retrieves
|
9
|
+
them.
|
10
|
+
|
11
|
+
What is SOA? What is a distributed object system?
|
12
|
+
|
13
|
+
HomeQ is a event-driven messaging application framework. It provides
|
14
|
+
key abstractions commonly used in building distributed computing
|
15
|
+
systems.
|
16
|
+
|
17
|
+
= INSTALLATION
|
18
|
+
|
19
|
+
You'll need a few gems to start:
|
20
|
+
|
21
|
+
sudo gem install eventmachine
|
22
|
+
sudo gem install statemachine
|
23
|
+
sudo gem install uuidtools
|
24
|
+
|
25
|
+
Highly recommended:
|
26
|
+
|
27
|
+
sudo gem install log4r
|
28
|
+
|
29
|
+
For debugging:
|
30
|
+
|
31
|
+
sudo gem install ruby-debug
|
32
|
+
|
33
|
+
= USAGE
|
34
|
+
|
35
|
+
= TODO
|
36
|
+
|
37
|
+
* rollingfileoutputter in logger; custom formatter that uses EM.current_time
|
38
|
+
* crib test stuff from sst; rake tasks for db dump, test, etc
|
39
|
+
* use include EM::Protocols::LineText2 in CP
|
40
|
+
* only one (singleton?) config
|
41
|
+
* too many config files????
|
42
|
+
* make it easier (methods, sugar) to add config items instead of:
|
43
|
+
# Make our config available
|
44
|
+
module HomeQ::Base::Commando::InstanceMethods
|
45
|
+
config_accessor :queue_retry
|
46
|
+
add_command "queue_retry [int]", "Get/set reconnect interval"
|
47
|
+
end
|
48
|
+
* startup hooks, not just the one block; ie before & after queue creation...
|
49
|
+
* more hooks/callbacks for Sys as it initializes, then runs
|
50
|
+
* SIGHUP log file reopening
|
51
|
+
* rework sst changes back into homeq
|
52
|
+
* move services subdirs to models
|
53
|
+
* standard generators don't create filenames correctly - needs snake/camel
|
54
|
+
* better usage for ./script/generate <foo>
|
55
|
+
* rake task to regenerate wire/*
|
56
|
+
* top level Rakefile in hq-generated apps
|
57
|
+
* better instrumentation, stats
|
58
|
+
* automated tests; unit tests w/fixtures
|
59
|
+
* ugly topology syntax; WNBI infix notation; use diesel DSL?
|
60
|
+
* better decoupling / abstraction between Connection and its children
|
61
|
+
* dynamic topology reconfig
|
62
|
+
* need to refactor - System shouldn't have @queues? -- delegate to Queue?
|
63
|
+
* ./script/generate model should create a migration a la rails
|
64
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
#############################################################################
|
2
|
+
#
|
3
|
+
# $Id: homeq.rb 8 2008-08-27 20:15:22Z colin $
|
4
|
+
#
|
5
|
+
# Author:: Colin Steele (colin@colinsteele.org)
|
6
|
+
#
|
7
|
+
#----------------------------------------------------------------------------
|
8
|
+
#
|
9
|
+
# Copyright (C) 2008 by Colin Steele. All Rights Reserved.
|
10
|
+
# colin@colinsteele.org
|
11
|
+
#
|
12
|
+
# This program is free software; you can redistribute it and/or modify
|
13
|
+
# it under the terms of either: 1) the GNU General Public License
|
14
|
+
# as published by the Free Software Foundation; either version 2 of the
|
15
|
+
# License, or (at your option) any later version; or 2) Ruby's License.
|
16
|
+
#
|
17
|
+
# See the file COPYING for complete licensing information.
|
18
|
+
#
|
19
|
+
#---------------------------------------------------------------------------
|
20
|
+
#
|
21
|
+
#
|
22
|
+
#############################################################################
|
23
|
+
|
24
|
+
$:.unshift(File.dirname(__FILE__) + "/lib")
|
25
|
+
|
26
|
+
require 'homeq'
|
27
|
+
require 'rubygems'
|
28
|
+
require 'rake'
|
29
|
+
require 'rubyforge'
|
30
|
+
|
31
|
+
PKG_NAME = "homeq"
|
32
|
+
PKG_VERSION = HOMEQ_VERSION
|
33
|
+
RUBYFORGE_GROUP_ID = 'homeq'
|
34
|
+
RUBYFORGE_PKG_NAME = 'homeq'
|
35
|
+
|
36
|
+
require 'rake/testtask'
|
37
|
+
require 'rake/rdoctask'
|
38
|
+
require 'rake/gempackagetask'
|
39
|
+
|
40
|
+
task :default => [:test]
|
41
|
+
|
42
|
+
desc "Create a new gem and install it"
|
43
|
+
task(:setup => :package) do
|
44
|
+
puts %x[cd pkg;pwd;sudo -p "Password:" gem install homeq-#{PKG_VERSION}.gem]
|
45
|
+
end
|
46
|
+
|
47
|
+
desc "Recreate the CHANGELOG"
|
48
|
+
task(:changelog) do
|
49
|
+
rm 'CHANGELOG', :force => true
|
50
|
+
touch 'CHANGELOG'
|
51
|
+
puts %x[svn2cl.sh]
|
52
|
+
end
|
53
|
+
|
54
|
+
Rake::TestTask.new do |t|
|
55
|
+
t.libs << "test"
|
56
|
+
t.test_files = FileList['test/**/*.rb']
|
57
|
+
end
|
58
|
+
|
59
|
+
Rake::RDocTask.new do |rd|
|
60
|
+
rd.main = "README.rdoc"
|
61
|
+
rd.rdoc_files.include("README.rdoc", 'COPYING', "lib/**/*.rb")
|
62
|
+
rd.rdoc_dir = 'doc'
|
63
|
+
rd.title = "HomeQ : Ruby Message Queue Framework"
|
64
|
+
rd.options << '--line-numbers'
|
65
|
+
rd.options << '--inline-source'
|
66
|
+
rd.options << '--main' << 'README.rdoc'
|
67
|
+
end
|
68
|
+
|
69
|
+
spec = Gem::Specification.new do |s|
|
70
|
+
s.platform = Gem::Platform::RUBY
|
71
|
+
s.name = PKG_NAME
|
72
|
+
s.version = PKG_VERSION
|
73
|
+
s.author = "Colin Steele"
|
74
|
+
s.email = "colin@colinsteele.org"
|
75
|
+
s.homepage = "http://rubyforge.org/projects/homeq/"
|
76
|
+
s.summary = "Ruby message queue framework."
|
77
|
+
s.files = Rake::FileList["{extras,lib,doc,bin,script,config}/**/*"].to_a
|
78
|
+
s.require_path = "lib"
|
79
|
+
s.test_files = Rake::FileList["{test}/**/*test.rb"].to_a
|
80
|
+
s.has_rdoc = true
|
81
|
+
s.extra_rdoc_files = ["README.rdoc", "COPYING", "Rakefile", "CHANGELOG"]
|
82
|
+
s.executables = ['hq']
|
83
|
+
s.add_dependency("statemachine", ">= 0.4.1")
|
84
|
+
s.add_dependency("eventmachine", ">= 0.12.0")
|
85
|
+
s.add_dependency("uuidtools", ">= 1.0.3")
|
86
|
+
s.add_dependency("log4r", ">= 1.0.5")
|
87
|
+
s.add_dependency("ruby_protobuf", ">= 0.3.0")
|
88
|
+
s.add_dependency("ruby-prof", ">= 0.6.0")
|
89
|
+
s.add_dependency("ruby-debug-base", "> 0.10.1")
|
90
|
+
s.add_dependency("ruby-debug", "> 0.10.1")
|
91
|
+
s.add_dependency("activesupport", ">= 0.6.0", '<= 2.3.4')
|
92
|
+
s.add_dependency("sequel", ">= 3.0.0")
|
93
|
+
s.description = <<EOF
|
94
|
+
HomeQ is a message queueing framework built on EventMachine.
|
95
|
+
EOF
|
96
|
+
end
|
97
|
+
|
98
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
99
|
+
pkg.need_zip = true
|
100
|
+
pkg.need_tar = true
|
101
|
+
end
|
102
|
+
|
103
|
+
desc 'Package and upload the release to rubyforge.'
|
104
|
+
task :release => [:clobber_package, :package, :uploaddoc] do |t|
|
105
|
+
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
106
|
+
abort "Versions don't match #{v} vs #{version}" if v != PKG_VERSION
|
107
|
+
pkg = "pkg/#{PKG_NAME}-#{v}"
|
108
|
+
|
109
|
+
if $DEBUG then
|
110
|
+
puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg}.tgz\""
|
111
|
+
puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg}.gem\""
|
112
|
+
end
|
113
|
+
|
114
|
+
rf = RubyForge.new.configure
|
115
|
+
puts "Logging in"
|
116
|
+
rf.login
|
117
|
+
|
118
|
+
c = rf.userconfig
|
119
|
+
c["release_notes"] = spec.description if spec.description
|
120
|
+
# c["release_changes"] = spec.changes if spec.changes
|
121
|
+
c["preformatted"] = true
|
122
|
+
|
123
|
+
p files = ["#{pkg}.tgz", "#{pkg}.zip", "#{pkg}.gem"]
|
124
|
+
puts "Releasing #{PKG_NAME} v. #{v}"
|
125
|
+
rf.add_release RUBYFORGE_GROUP_ID, RUBYFORGE_PKG_NAME, v, *files
|
126
|
+
end
|
127
|
+
|
128
|
+
desc 'Upload docs to rubyforge website'
|
129
|
+
task :uploaddoc => [:rdoc] do |t|
|
130
|
+
system %{scp -r doc/* colinsteele@rubyforge.org:/var/www/gforge-projects/homeq}
|
131
|
+
end
|