blue_colr 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +17 -3
- data/bin/bluecolrd +4 -2
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -46,6 +46,20 @@ Note: the code above will not _start_ the processes by itself, but enqueue them
|
|
46
46
|
to the database, by default. A separate process called +bluecolrd+ is
|
47
47
|
used for that.
|
48
48
|
|
49
|
+
== Requirements and Configuration
|
50
|
+
|
51
|
+
Blue_colr uses a relational database to simulate a process queue so you will have
|
52
|
+
to provide one. It relies on two tables, named +process_items+ and
|
53
|
+
+process_item_dependencies+ to work. +db/+ directory contains Postgresql scripts
|
54
|
+
for creating these two, and this should be moved to Sequel migration later.
|
55
|
+
|
56
|
+
In order to access the database, blue_colr requires sequel ORM library, if you
|
57
|
+
don't have it, its gem will be installed along with blue_colr.
|
58
|
+
|
59
|
+
Basic configuration is passed to blue_colr either by setting options from your
|
60
|
+
code, or (if not set), blue_colr will parse your command line arguments and
|
61
|
+
get the path to yaml configuration file, using +-c+ option.
|
62
|
+
|
49
63
|
== <tt>bluecolrd</tt>
|
50
64
|
|
51
65
|
Blue_colr daemon is constantly running, checking the database for newly enqueued
|
@@ -59,7 +73,7 @@ through a database table).
|
|
59
73
|
|
60
74
|
bcrun -c path_to_config.yaml -x "command to execute"
|
61
75
|
|
62
|
-
==
|
76
|
+
== Environments
|
63
77
|
|
64
78
|
An environment is something like _category_ which you assign to a set of processes
|
65
79
|
when enqueuing them. Then you can have multiple daemons running, each one of them
|
@@ -71,7 +85,7 @@ multiple machines, while keeping them synchronized, like the following scenario:
|
|
71
85
|
|
72
86
|
== ToDo
|
73
87
|
|
74
|
-
*
|
75
|
-
*
|
88
|
+
* Move db table creation scripts to Sequel migration
|
89
|
+
* Write proper tests
|
76
90
|
* Examples
|
77
91
|
|
data/bin/bluecolrd
CHANGED
@@ -77,8 +77,8 @@ end
|
|
77
77
|
|
78
78
|
# check whether it's ok to spawn another process
|
79
79
|
def ok_to_run?
|
80
|
-
# check the limit of max processes, if given
|
81
|
-
@max_processes == 0 ||
|
80
|
+
# check the limit of max processes, if given
|
81
|
+
@max_processes == 0 || ThreadGroup::Default.list.size <= @max_processes
|
82
82
|
# !@args['max'] || @pids.size < @args['max']
|
83
83
|
end
|
84
84
|
|
@@ -161,6 +161,8 @@ having count(i2.id) = 0"
|
|
161
161
|
if ok_to_run?
|
162
162
|
item = @db[:process_items].filter(:id => id[:id]).first
|
163
163
|
run(item)
|
164
|
+
else
|
165
|
+
logger.debug "No available thread, waiting"
|
164
166
|
end
|
165
167
|
end
|
166
168
|
sleep(@conf['sleep_interval'] || 10)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blue_colr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mladen Jablanovic
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-11 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|