disc 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +23 -0
- data/LICENSE.md +21 -0
- data/README.md +20 -7
- data/bin/disc +0 -1
- data/disc.gemspec +1 -1
- data/disc_init_example.rb +0 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c2746334c1546fd6af07dfe051d00d78dc744e6
|
4
|
+
data.tar.gz: 5dbb81b47fafb4b5154a6d060031d798438f7ee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b6e731da78fc1b71500b8e3f106c11b6594f32d24ca32e406c61a97b64c51052a4945711d01d8515d65a19b158eca3c3ef92db9428b8982664961e31ebfaca
|
7
|
+
data.tar.gz: 723fe3c1a28d801fe097bdbe82cff40c9e3b34147eafe6defecb70cbd802c655932c7677a9c6a4ff408f82a33e27a6e6ddce6894a2e502bcf28c77ab7e4c9395
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
### The Soveran Contribution Guidelines.
|
2
|
+
|
3
|
+
(taken from some project at https://github.com/soveran)
|
4
|
+
|
5
|
+
This code tries to solve a particular problem with a very simple
|
6
|
+
implementation. We try to keep the code to a minimum while making
|
7
|
+
it as clear as possible. The design is very likely finished, and
|
8
|
+
if some feature is missing it is possible that it was left out on
|
9
|
+
purpose. That said, new usage patterns may arise, and when that
|
10
|
+
happens we are ready to adapt if necessary.
|
11
|
+
|
12
|
+
A good first step for contributing is to meet us on IRC and discuss
|
13
|
+
ideas. We spend a lot of time on #lesscode at freenode, always ready
|
14
|
+
to talk about code and simplicity. If connecting to IRC is not an
|
15
|
+
option, you can create an issue explaining the proposed change and
|
16
|
+
a use case. We pay a lot of attention to use cases, because our
|
17
|
+
goal is to keep the code base simple. Usually the result of a
|
18
|
+
conversation is the creation of a different tool.
|
19
|
+
|
20
|
+
Please don't start the conversation with a pull request. The code
|
21
|
+
should come at last, and even though it may help to convey an idea,
|
22
|
+
more often than not it draws the attention to a particular
|
23
|
+
implementation.
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2015 Pablo Astigarraga | pote <pote@tardis.com.uy>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Disc fills the gap between your Ruby service objects and [antirez](http://antire
|
|
17
17
|
2. Write your jobs
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
|
20
|
+
require 'disc'
|
21
21
|
|
22
22
|
class CreateGameGrid
|
23
23
|
include Disc::Job
|
@@ -52,7 +52,7 @@ Disc fills the gap between your Ruby service objects and [antirez](http://antire
|
|
52
52
|
6. Set your require file
|
53
53
|
|
54
54
|
```bash
|
55
|
-
$ export
|
55
|
+
$ export DISC_REQUIRE='./disc_init.rb'
|
56
56
|
```
|
57
57
|
|
58
58
|
7. Run as many Disc Worker processes as you wish.
|
@@ -61,17 +61,30 @@ Disc fills the gap between your Ruby service objects and [antirez](http://antire
|
|
61
61
|
$ QUEUES=urgent,default disc
|
62
62
|
```
|
63
63
|
|
64
|
-
|
64
|
+
## Settings
|
65
65
|
|
66
|
+
Disc takes its configuration from environment variables.
|
66
67
|
|
67
|
-
|
68
|
+
| ENV Variable | Default Value | Description
|
69
|
+
|:----------------:|:-----------------|:------------|
|
70
|
+
| DISC_REQUIRE | null | Ruby file that will be required by the worker processes, it should load all Disc::Job classes on your application and whatever else is needed to run them.
|
71
|
+
| QUEUES | 'default' | The list of queues that `Disc::Worker` will listen to, it can be a single queue name or a list of comma-separated queues |
|
72
|
+
| DISC_CONCURRENCY | '25' | Amount of threads to spawn when Celluloid is available. |
|
73
|
+
| DISQUE_NODES | 'localhost:7711' | This is the list of Disque servers to connect to, it can be a single node or a list of comma-separated nodes |
|
74
|
+
| DISQUE_AUTH | '' | Authorization credentials for Disque. |
|
75
|
+
| DISQUE_TIMEOUT | '100' | Time in milliseconds that the client will wait for the Disque server to acknowledge and replicate a job |
|
76
|
+
| DISQUE_CYCLE | '1000' | The client keeps track of which nodes are providing more jobs, after the amount of operations specified in cycle it tries to connect to the preferred node. |
|
68
77
|
|
69
|
-
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
## PowerUps
|
82
|
+
|
83
|
+
Disc workers can run just fine on their own, but if you're using [Celluloid](https://github.com/celluloid/celluloid) you migth want Disc to take advantage of it and spawn multiple worker threads per process, doing this is trivial! Just require Celluloid in your `DISC_REQUIRE` file.
|
70
84
|
|
71
85
|
```ruby
|
72
86
|
# disq_init.rb
|
73
|
-
|
74
87
|
require 'celluloid'
|
75
88
|
```
|
76
89
|
|
77
|
-
Whenever Disc detects that Celluloid is available it will
|
90
|
+
Whenever Disc detects that Celluloid is available it will use it to spawn a number of threads equal to the `DISC_CONCURRENCY` environment variable, or 25 by default.
|
data/bin/disc
CHANGED
data/disc.gemspec
CHANGED
data/disc_init_example.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: disc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pote
|
@@ -48,6 +48,8 @@ extra_rdoc_files: []
|
|
48
48
|
files:
|
49
49
|
- ".gems"
|
50
50
|
- ".gitignore"
|
51
|
+
- CONTRIBUTING.md
|
52
|
+
- LICENSE.md
|
51
53
|
- Makefile
|
52
54
|
- README.md
|
53
55
|
- bin/disc
|