active_publisher 1.2.0.pre5 → 1.2.0.pre6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f2dab5370f3b41d1b6e0c6d31f2da54f40528c
|
4
|
+
data.tar.gz: dc04b0a100a216a194ef30f5bb07c1fb27f17982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f5c82a0923940966d5ce4d66e8448f129246b9dd54481313164ceb6c82231fad94522ee5dfbbe4e307d643aff7d8f7e06570343f44cdee22ac452962b6bd29
|
7
|
+
data.tar.gz: 1ee748a6f8e1a145d2b395598d25385e347f61310523928c8776df1ac9aa8187a11dd2dd7c5bf0d645e8908282dc304fa4a5f9825320488f31045bfdbddac0a5
|
@@ -13,7 +13,7 @@ module ActivePublisher
|
|
13
13
|
encoded_message = ::Marshal.dump(message)
|
14
14
|
|
15
15
|
redis_pool.with do |redis|
|
16
|
-
redis.
|
16
|
+
redis.rpush(list_key, encoded_message)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -28,7 +28,7 @@ module ActivePublisher
|
|
28
28
|
end
|
29
29
|
|
30
30
|
redis_pool.with do |redis|
|
31
|
-
redis.
|
31
|
+
redis.rpush(list_key, encoded_messages)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -71,25 +71,30 @@ module ActivePublisher
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def shift(number)
|
74
|
-
messages = []
|
75
74
|
number = [number, size].min
|
75
|
+
return [] if number <= 0
|
76
|
+
|
77
|
+
messages = []
|
78
|
+
multi_response = []
|
76
79
|
redis_pool.with do |redis|
|
77
|
-
redis.
|
78
|
-
|
79
|
-
|
80
|
-
end
|
80
|
+
multi_response = redis.multi do
|
81
|
+
redis.lrange(list_key, 0, number - 1)
|
82
|
+
redis.ltrim(list_key, number, -1)
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
86
|
+
messages = multi_response.first
|
87
|
+
success = multi_response.last
|
88
|
+
return [] unless success =~ /ok/i
|
89
|
+
|
84
90
|
messages = [] if messages.nil?
|
85
91
|
messages = [messages] unless messages.respond_to?(:each)
|
86
92
|
|
87
93
|
shifted_messages = []
|
88
94
|
messages.each do |message|
|
89
|
-
next
|
90
|
-
next if message.value.nil?
|
95
|
+
next if message.nil?
|
91
96
|
|
92
|
-
shifted_messages << ::Marshal.load(message
|
97
|
+
shifted_messages << ::Marshal.load(message)
|
93
98
|
end
|
94
99
|
|
95
100
|
shifted_messages
|
@@ -65,7 +65,7 @@ module ActivePublisher
|
|
65
65
|
return unless encoded_messages.size > 0
|
66
66
|
|
67
67
|
redis_pool.with do |redis|
|
68
|
-
redis.
|
68
|
+
redis.rpush(::ActivePublisher::Async::RedisAdapter::REDIS_LIST_KEY, encoded_messages)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0.
|
4
|
+
version: 1.2.0.pre6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Stien
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-01-
|
15
|
+
date: 2018-01-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bunny
|