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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53fa243a900cc1cd82d6b40b35eb9b358135e418
4
- data.tar.gz: 52e5b596f04a49bfe87661949138aeef04decb50
3
+ metadata.gz: 0081b227e9f7794ea8651ef2966b223c72a0fe6b
4
+ data.tar.gz: a448cd19e5f8a3b15c177cbd5a75159de298fecb
5
5
  SHA512:
6
- metadata.gz: 5cdb8709ae4946fcd0c90fbe28bed5d16f43073f876ccf6551415360f87df3cccfacd0f07244679dcb3114efb9c98ebd0a44347bc04606c746ad82d3f2dd237d
7
- data.tar.gz: f790b52f3421cdb5ebad50577ec1c8646d0c65867acfd46a27e79375e0ec8d1f6bc290a0f8c29e6fea3d16246db99ebc4aaa8d559527ebadb1cac1e1c5181a98
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
@@ -5,7 +5,6 @@ class Greeter
5
5
  disc queue: 'test_medium'
6
6
 
7
7
  def perform(string)
8
- `say #{string}`
9
8
  $stdout.puts(string)
10
9
  end
11
10
  end
@@ -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').to_i
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[:disque] || Disc.disque
47
- @count = (options[:count] || ENV.fetch('DISQUE_COUNT', '1')).to_i
48
- @timeout = (options[:timeout] || ENV.fetch('DISQUE_TIMEOUT', '2000')).to_i
49
-
50
- @queues = case
51
- when options[:queues].is_a?(Array)
52
- options[:queues]
53
- when options[:queues].is_a?(String)
54
- options[:queues].split(',')
55
- when options[:queues].nil?
56
- ENV.fetch('QUEUES', 'default').split(',')
57
- else
58
- raise 'Invalid Disque Queues'
59
- end
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
 
@@ -1,3 +1,3 @@
1
1
  class Disc
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -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')
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.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - pote