disc 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/examples/greeter.rb +0 -1
- data/lib/disc.rb +18 -16
- data/lib/disc/version.rb +1 -1
- data/test/disc_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0081b227e9f7794ea8651ef2966b223c72a0fe6b
|
4
|
+
data.tar.gz: a448cd19e5f8a3b15c177cbd5a75159de298fecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c77f98a2e0a805beeb9996c8b14e1d529ea99cec467c895df4409bfc111b976f4924d4248793ba64cba772557dc2e57a4b01df8a430e88e38e412d4fcaa0911
|
7
|
+
data.tar.gz: dda30cd643665212bf5649a147d899a6ffcd9191b2a12e0ce8b219791205f340462b89220c8c1127737c28fb1c3571bdd7aea3f66337af0c77c049029147dbf0
|
data/README.md
CHANGED
@@ -141,6 +141,11 @@ CluJob.perform_later(a_bunch_of_arguments)
|
|
141
141
|
|
142
142
|
As always, make sure your `disc_init.rb` file requires the necessary jobs and you'll be good to go!
|
143
143
|
|
144
|
+
|
145
|
+
## A note on stability.
|
146
|
+
|
147
|
+
The version of Disque at the time of this writing is `0.0.1`. It is a wonderful project, I know of people running it in production, and I expect it will only get better and better with time, but please do not expect Disc to be more production ready than Disque is, Disque still gives me the occasional segfault when running Disc's test suite.
|
148
|
+
|
144
149
|
## License
|
145
150
|
|
146
151
|
The code is released under an MIT license. See the [LICENSE](./LICENSE) file for
|
data/examples/greeter.rb
CHANGED
data/lib/disc.rb
CHANGED
@@ -12,7 +12,7 @@ class Disc
|
|
12
12
|
@disque ||= Disque.new(
|
13
13
|
ENV.fetch('DISQUE_NODES', 'localhost:7711'),
|
14
14
|
auth: ENV.fetch('DISQUE_AUTH', nil),
|
15
|
-
cycle: ENV.fetch('DISQUE_CYCLE', '1000')
|
15
|
+
cycle: Integer(ENV.fetch('DISQUE_CYCLE', '1000'))
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
@@ -43,23 +43,25 @@ class Disc
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def initialize(options = {})
|
46
|
-
@disque = options
|
47
|
-
@
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
46
|
+
@disque = options.fetch(:disque, Disc.disque)
|
47
|
+
@queues = options.fetch(
|
48
|
+
:queues,
|
49
|
+
ENV.fetch('QUEUES', 'default')
|
50
|
+
)
|
51
|
+
@count = Integer(
|
52
|
+
options.fetch(
|
53
|
+
:count,
|
54
|
+
ENV.fetch('DISQUE_COUNT', '1')
|
55
|
+
)
|
56
|
+
)
|
57
|
+
@timeout = Integer(
|
58
|
+
options.fetch(
|
59
|
+
:timeout,
|
60
|
+
ENV.fetch('DISQUE_TIMEOUT', '2000')
|
61
|
+
)
|
62
|
+
)
|
60
63
|
|
61
64
|
self.run if options[:run]
|
62
|
-
|
63
65
|
self
|
64
66
|
end
|
65
67
|
|
data/lib/disc/version.rb
CHANGED
data/test/disc_test.rb
CHANGED
@@ -4,6 +4,14 @@ require 'msgpack'
|
|
4
4
|
require 'pty'
|
5
5
|
|
6
6
|
require_relative '../examples/echoer'
|
7
|
+
# class Echoer
|
8
|
+
# include Disc::Job
|
9
|
+
# disc queue: 'test_urgent'
|
10
|
+
#
|
11
|
+
# def perform(first, second, third)
|
12
|
+
# puts "First: #{ first }, Second: #{ second }, Third: #{ third }"
|
13
|
+
# end
|
14
|
+
# end
|
7
15
|
|
8
16
|
prepare do
|
9
17
|
Disc.disque.call('DEBUG', 'FLUSHALL')
|