disc 0.0.24 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/bin/disc +14 -3
- data/lib/disc/testing.rb +9 -0
- data/lib/disc/version.rb +1 -1
- data/lib/disc.rb +17 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1620d0f0752ee08feff06a19d5e83c23afbce91
|
4
|
+
data.tar.gz: dbaa723df114c6dead5260ec688c0cb144d60946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da67f0364f6e4c0fab1289d94e0053f539c1d784981821e937315fc91f0e24893fdfdcadc37dbab15c1ac47f18695bde6f7eb17a21074af224e174f48490116a
|
7
|
+
data.tar.gz: b27a52e29cfe6017d6adeac0b125cbe4f0c9c555b4d7057e8c67e4234774325186ebdca1f84eab6415050fa2776f9dc0277336f8718e305de32876133d3cd7a3
|
data/.travis.yml
CHANGED
@@ -14,8 +14,6 @@ install:
|
|
14
14
|
- export GEM_HOME=$PWD/gems/$RUBY_VERSION
|
15
15
|
- export GEM_PATH=$GEM_HOME:$GEM_PATH
|
16
16
|
- export PATH=$GEM_HOME/bin:$PWD/disque/src:$PATH
|
17
|
-
-
|
18
|
-
- which dep || gem install dep
|
19
|
-
- dep install
|
17
|
+
- cat .gems* | xargs gem install
|
20
18
|
before_script: disque-server --daemonize yes
|
21
19
|
script: make test
|
data/bin/disc
CHANGED
@@ -1,14 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'disc'
|
4
|
-
require 'clap'
|
5
|
-
|
6
3
|
if ARGV.empty?
|
7
4
|
$stdout.puts('Usage: disc -r FILE')
|
8
5
|
|
9
6
|
exit(1)
|
10
7
|
end
|
11
8
|
|
9
|
+
stop = proc do
|
10
|
+
if defined?(Disc)
|
11
|
+
Disc::Worker.stop
|
12
|
+
else
|
13
|
+
exit 0
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
trap(:INT, &stop)
|
18
|
+
trap(:TERM, &stop)
|
19
|
+
|
20
|
+
require 'clap'
|
21
|
+
require_relative '../lib/disc'
|
22
|
+
|
12
23
|
Clap.run ARGV,
|
13
24
|
"-r" => lambda { |file| require file }
|
14
25
|
|
data/lib/disc/testing.rb
ADDED
data/lib/disc/version.rb
CHANGED
data/lib/disc.rb
CHANGED
@@ -46,8 +46,16 @@ class Disc
|
|
46
46
|
:timeout,
|
47
47
|
:count
|
48
48
|
|
49
|
+
def self.current
|
50
|
+
@current ||= new
|
51
|
+
end
|
52
|
+
|
49
53
|
def self.run
|
50
|
-
|
54
|
+
current.run
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.stop
|
58
|
+
current.stop
|
51
59
|
end
|
52
60
|
|
53
61
|
def initialize(options = {})
|
@@ -73,6 +81,10 @@ class Disc
|
|
73
81
|
self
|
74
82
|
end
|
75
83
|
|
84
|
+
def stop
|
85
|
+
@stop = true
|
86
|
+
end
|
87
|
+
|
76
88
|
def run
|
77
89
|
$stdout.puts("Disc::Worker listening in #{queues}")
|
78
90
|
loop do
|
@@ -87,7 +99,11 @@ class Disc
|
|
87
99
|
Disc.on_error(err, job.update('id' => msgid, 'queue' => queue))
|
88
100
|
end
|
89
101
|
end
|
102
|
+
|
103
|
+
break if @stop
|
90
104
|
end
|
105
|
+
ensure
|
106
|
+
disque.quit
|
91
107
|
end
|
92
108
|
end
|
93
109
|
|
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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pote
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: disque
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- examples/greeter.rb
|
84
84
|
- lib/active_job/queue_adapters/disc_adapter.rb
|
85
85
|
- lib/disc.rb
|
86
|
+
- lib/disc/testing.rb
|
86
87
|
- lib/disc/version.rb
|
87
88
|
- test/disc_test.rb
|
88
89
|
homepage: https://github.com/pote/disc
|