litejob 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/litejob/server.rb +4 -1
- data/lib/litejob/version.rb +1 -1
- data/lib/litejob.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9235b916ceb5620f30e307e23adb1c3baf256625a3d3cedde1c2851faa9ed490
|
4
|
+
data.tar.gz: 553500fbb22d4ef729a6059277cb56738c87b671e4009ac9c3b7174293f7bfb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86125548df029a4a0035314ff34f3a429394079d56b88075e7b05ec72a4975a9b7ee32ed130bef939cfe4edd6a6cbc02b46458e011df847fd942efbbdbd36562
|
7
|
+
data.tar.gz: 50f38790e97d1b19462a5926bd2a92fbcbc9485ccadf2c89a9c1f1effc4ccd566650bea57400793d3d11aec0390c647f81e04d2ead1963aa0889f9522918654a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/litejob/server.rb
CHANGED
@@ -2,11 +2,14 @@
|
|
2
2
|
|
3
3
|
require "litequeue"
|
4
4
|
require "litescheduler"
|
5
|
+
require_relative "processor"
|
5
6
|
|
6
7
|
module Litejob
|
7
8
|
# Litejob::Server is responsible for popping job payloads from the SQLite queue.
|
8
9
|
# :nocov:
|
9
10
|
class Server
|
11
|
+
# TODO: make queues use [["default", 1]]
|
12
|
+
# TODO: make queue priorities optional
|
10
13
|
def initialize(queues)
|
11
14
|
@queue = Litequeue.instance
|
12
15
|
@scheduler = Litescheduler.instance
|
@@ -26,7 +29,7 @@ module Litejob
|
|
26
29
|
def pop(queue)
|
27
30
|
result = @queue.pop(queue: queue)
|
28
31
|
|
29
|
-
return result
|
32
|
+
return result unless result.is_a?(Array)
|
30
33
|
return false if result.empty?
|
31
34
|
|
32
35
|
result
|
data/lib/litejob/version.rb
CHANGED
data/lib/litejob.rb
CHANGED