redis-scheduler 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/redis-scheduler.rb +3 -2
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 119e0e42239d8d6f0df0ab381135d55cfe73efec
|
4
|
+
data.tar.gz: ed15962b933d1b4e0adb64d873cb72338b20a52d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e04c00b6ee38ed895c454725a5d239bd0182dd8642d90c5516339058c2071cf06d23308474556b7c30fac4dcfba79863e0c4b6e9692dd6c2504b13ffad31deda
|
7
|
+
data.tar.gz: 5f0e2268f031c80d28673531b86557a3339f57edbbbc46e97593640e808101714a564f0327962bd54e1bcb8d57900688d0277341e9da25db4cba2c4446be685c
|
data/lib/redis-scheduler.rb
CHANGED
@@ -122,8 +122,9 @@ private
|
|
122
122
|
def nonblocking_get descriptor
|
123
123
|
loop do
|
124
124
|
@redis.watch @queue
|
125
|
-
|
126
|
-
break unless
|
125
|
+
entries = @redis.zrangebyscore @queue, 0, Time.now.to_f, :withscores => true, :limit => [0, 1]
|
126
|
+
break unless entries.size > 0
|
127
|
+
entry, at = entries.first
|
127
128
|
entry =~ /^\d+:(\S+)$/ or raise InvalidEntryException, entry
|
128
129
|
item = $1
|
129
130
|
descriptor = Marshal.dump [item, Time.now.to_i, descriptor]
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.6'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- William Morgan
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A basic chronological scheduler for Redis. Add work items to be processed
|
15
14
|
at specific times in the future, and easily retrieve all items that are ready for
|
@@ -24,6 +23,7 @@ files:
|
|
24
23
|
- lib/redis-scheduler.rb
|
25
24
|
homepage: http://gitub.com/wmorgan/redis-scheduler
|
26
25
|
licenses: []
|
26
|
+
metadata: {}
|
27
27
|
post_install_message:
|
28
28
|
rdoc_options:
|
29
29
|
- -c
|
@@ -33,21 +33,19 @@ rdoc_options:
|
|
33
33
|
require_paths:
|
34
34
|
- lib
|
35
35
|
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
36
|
requirements:
|
38
|
-
- -
|
37
|
+
- - '>='
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '0'
|
41
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
41
|
requirements:
|
44
|
-
- -
|
42
|
+
- - '>='
|
45
43
|
- !ruby/object:Gem::Version
|
46
44
|
version: '0'
|
47
45
|
requirements: []
|
48
46
|
rubyforge_project:
|
49
|
-
rubygems_version:
|
47
|
+
rubygems_version: 2.0.14
|
50
48
|
signing_key:
|
51
|
-
specification_version:
|
49
|
+
specification_version: 4
|
52
50
|
summary: A basic chronological scheduler for Redis.
|
53
51
|
test_files: []
|