sponges 0.1.2 → 0.1.3
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.md +5 -3
- data/lib/sponges.rb +3 -2
- data/lib/sponges/cli.rb +1 -0
- data/lib/sponges/configuration.rb +1 -1
- data/lib/sponges/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -6,8 +6,8 @@ control them, and, well, to kill them gracefully. Making them stressed and eager
|
|
6
6
|
to work is your job. :)
|
7
7
|
|
8
8
|
Basically, sponges is a ruby supervisor that forks processes and controls their
|
9
|
-
execution and termination. For example the following will start a supervision
|
10
|
-
daemon and 8 processes of "a_worker".
|
9
|
+
execution and termination. For example the following will start a supervision
|
10
|
+
daemon and 8 processes of "a_worker".
|
11
11
|
```bash
|
12
12
|
ruby a_worker.rb start -d -s 8
|
13
13
|
```
|
@@ -66,7 +66,9 @@ Sponges.configure do |config|
|
|
66
66
|
end
|
67
67
|
|
68
68
|
# Register a pool named "worker_name".
|
69
|
-
|
69
|
+
# Options are optionnal. Consider it as a default, options given by command have
|
70
|
+
# the precedence.
|
71
|
+
Sponges.start "worker_name", {size: 3, daemonize: true} do
|
70
72
|
Worker.new({some: args}).run
|
71
73
|
end
|
72
74
|
```
|
data/lib/sponges.rb
CHANGED
@@ -18,10 +18,11 @@ module Sponges
|
|
18
18
|
end
|
19
19
|
module_function :configure
|
20
20
|
|
21
|
-
def start(worker_name, options = ARGV, &block)
|
21
|
+
def start(worker_name, options = {}, argv = ARGV, &block)
|
22
22
|
Sponges::Configuration.worker_name = worker_name
|
23
23
|
Sponges::Configuration.worker = block
|
24
|
-
Sponges::
|
24
|
+
Sponges::Configuration.options = options
|
25
|
+
Sponges::Cli.start(argv)
|
25
26
|
end
|
26
27
|
module_function :start
|
27
28
|
|
data/lib/sponges/cli.rb
CHANGED
data/lib/sponges/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sponges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: boson
|