active_publisher 1.2.0.pre5-java → 1.2.0.pre6-java
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d1b9773427c5ae05fa5d590f83f270141ca1b8ccc4811fb163be87c98a80af
|
4
|
+
data.tar.gz: c1f2f8231212d9d3ccb7a6a8d2cc4e5b2786637915d7e0b2447598f114085af0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d67ce2651ec0e6d3db5c84e11af82a71f4a2a5c0410b9991c846d4263527ec5479be7044573c2f605cca31edf8b512ec557e7cd5a5865fca8aafb884b1f5b3
|
7
|
+
data.tar.gz: d598c499b8e78152c9f5b50ffe97cbda35b201c7523635f441480ea88e175d503804d522e87c5750024ccbbdec6fbf8413640607c7da74d38f28178b0cbbd02c
|
@@ -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
|
@@ -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
|
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: java
|
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
|
requirement: !ruby/object:Gem::Requirement
|