disc 0.0.8 → 0.0.9

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -9
  3. data/lib/disc.rb +5 -9
  4. data/lib/disc/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5ee2da4bef94664480d83b714c143e5c45e3cac
4
- data.tar.gz: 387342a78355c0cac2dc8d344ec23332a71d3841
3
+ metadata.gz: a8c13e7e4ec525c4779d4d13e5164e6c0db6b97d
4
+ data.tar.gz: 8d423e9024f07932f44836ba3d41d5b795c5f7d9
5
5
  SHA512:
6
- metadata.gz: 5e20e956400a9dc713f36e4aa47ff61261c9e66c0d3f2ee8f5b523d6aeecfbe498eb6d29339cbd62bd5f85f4a00a12f43986b8670e4668967fdc3a64499837e8
7
- data.tar.gz: 1fff7b0e2f8832e3c74da9d154893765ac5f49294ba0b3167dd738c8daf1749a641584281cb2bdc872e18f280c7caccc07ca55c9bac73e0d15e3e4fde28c660e
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('ligth_cycle')
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 | 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. |
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
 
@@ -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 && (datetime.to_time.to_i - DateTime.now.to_time.to_i)
141
+ delay: datetime.nil? ? nil : (datetime.to_time.to_i - DateTime.now.to_time.to_i)
146
142
  )
147
143
  end
148
144
  end
@@ -1,3 +1,3 @@
1
1
  class Disc
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
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-12 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: disque