disc 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/disc.rb +5 -9
- data/lib/disc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8c13e7e4ec525c4779d4d13e5164e6c0db6b97d
|
4
|
+
data.tar.gz: 8d423e9024f07932f44836ba3d41d5b795c5f7d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdbc76ac8cf2678816048219b8e7f962f2b6564c8e43b35af26d371af773720aa12c1a1113e563b982dcf4ab4dd8461926446ebd5c0ab875ebc1dbbac9f57908
|
7
|
+
data.tar.gz: d10b168948292c66d2626c213eef0551d9a0044407641292d59880b4032c4a2da683d18590b680d3a29ffadcc7356d98936cb33ee96963905edeee3e1149d983
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Disc fills the gap between your Ruby service objects and [antirez](http://antire
|
|
32
32
|
3. Enqueue them to perform them asynchronously
|
33
33
|
|
34
34
|
```ruby
|
35
|
-
CreateGameGrid.enqueue('
|
35
|
+
CreateGameGrid.enqueue('light_cycle')
|
36
36
|
```
|
37
37
|
|
38
38
|
4. Or enqueue them to be performed at some time in the future.
|
@@ -59,14 +59,14 @@ Disc fills the gap between your Ruby service objects and [antirez](http://antire
|
|
59
59
|
|
60
60
|
Disc takes its configuration from environment variables.
|
61
61
|
|
62
|
-
| ENV Variable
|
63
|
-
|
64
|
-
| 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 |
|
65
|
-
| DISC_CONCURRENCY | '25' | Amount of threads to spawn when Celluloid is available. |
|
66
|
-
| 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 |
|
67
|
-
| DISQUE_AUTH | '' | Authorization credentials for Disque. |
|
68
|
-
| DISQUE_TIMEOUT | '100' | Time in milliseconds that the client will wait for the Disque server to acknowledge and replicate a job |
|
69
|
-
| 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. |
|
62
|
+
| ENV Variable | Default Value | Description
|
63
|
+
|:------------------:|:-----------------|:------------|
|
64
|
+
| `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 |
|
65
|
+
| `DISC_CONCURRENCY` | '25' | Amount of threads to spawn when Celluloid is available. |
|
66
|
+
| `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 |
|
67
|
+
| `DISQUE_AUTH` | '' | Authorization credentials for Disque. |
|
68
|
+
| `DISQUE_TIMEOUT` | '100' | Time in milliseconds that the client will wait for the Disque server to acknowledge and replicate a job |
|
69
|
+
| `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. |
|
70
70
|
|
71
71
|
## Error handling
|
72
72
|
|
data/lib/disc.rb
CHANGED
@@ -127,22 +127,18 @@ class Disc
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def enqueue(*args)
|
130
|
+
enqueue_at(nil, args)
|
131
|
+
end
|
132
|
+
|
133
|
+
def enqueue_at(datetime, *args)
|
130
134
|
disque.push(
|
131
135
|
queue,
|
132
136
|
{
|
133
137
|
class: self.new.class.name,
|
134
138
|
arguments: args
|
135
139
|
}.to_msgpack,
|
136
|
-
Disc.disque_timeout
|
137
|
-
)
|
138
|
-
end
|
139
|
-
|
140
|
-
def enqueue_at(datetime, *args)
|
141
|
-
disque.push(
|
142
|
-
queue,
|
143
|
-
args.to_msgpack,
|
144
140
|
Disc.disque_timeout,
|
145
|
-
delay: datetime
|
141
|
+
delay: datetime.nil? ? nil : (datetime.to_time.to_i - DateTime.now.to_time.to_i)
|
146
142
|
)
|
147
143
|
end
|
148
144
|
end
|
data/lib/disc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pote
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: disque
|