fairway 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/go/fairway_deliver.go +8 -8
- data/lib/fairway/version.rb +1 -1
- data/redis/fairway_deliver.lua +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTY4Y2NjNWRkYTM0NzYwY2U3NWRmNzhmMWE3ZmVhY2M3MTlhMjc0Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzJjNmNjMTNmMGUxN2MyNjNlZWQ2MGE4MTY3OTg5NWMxZjU2NzZkYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWZmNmY3YmI5NDkyZGZmMDBhNWZkZDEyOGY3MWYxNmMzMWE3YTM3ZDRmNjdk
|
10
|
+
NGZmMzMwZjk3NDdmNGI5YTIzYjI2YzkyN2M0Nzc0YjA2Yzc4MDYxZTllZWE2
|
11
|
+
MWYwMDdhZmVmODE1ODcyZTRiNzViZDQ3ZWJiNDZlNGM2Y2M2ZTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Mzk4MDdhNGNhNWU1ZWM3OGVjZTZkZTI5YzMxNzE3YWY2NDM4YmExMzRiMjI4
|
14
|
+
M2U5YzBmZjFjYjVlNzE3MjhmZDlkZTQwYTBmMGU3MTM3OWViZjFlNjQzNGY4
|
15
|
+
MzMwOTM3ZjU0ODQ1YWFlZjZjNmJhYmU1MTdiMjQ3N2RjMTM5NjM=
|
data/Gemfile.lock
CHANGED
data/go/fairway_deliver.go
CHANGED
@@ -27,8 +27,8 @@ for i = 1, #registered_queues, 2 do
|
|
27
27
|
local active_facets = k(queue, 'active_facets');
|
28
28
|
local round_robin = k(queue, 'facet_queue');
|
29
29
|
local facet_pool = k(queue, 'facet_pool');
|
30
|
-
|
31
|
-
|
30
|
+
local inflight_facet = k(queue, facet .. ':inflight');
|
31
|
+
local inflight_limit = k(queue, 'limit');
|
32
32
|
|
33
33
|
-- Delivering the message to a queue is as simple as
|
34
34
|
-- pushing it onto the facet's message list, and
|
@@ -39,18 +39,18 @@ for i = 1, #registered_queues, 2 do
|
|
39
39
|
-- Manage facet queue and active facets
|
40
40
|
local current = tonumber(redis.call('hget', facet_pool, facet)) or 0;
|
41
41
|
local priority = tonumber(redis.call('hget', priorities, facet)) or 1;
|
42
|
-
|
43
|
-
|
42
|
+
local inflight_cur = tonumber(redis.call('scard', inflight_facet)) or 0;
|
43
|
+
local inflight_max = tonumber(redis.call('get', inflight_limit)) or 0;
|
44
44
|
|
45
45
|
local n = 0
|
46
46
|
|
47
47
|
-- redis.log(redis.LOG_WARNING, current.."/"..length.."/"..priority.."/"..inflight_max.."/"..inflight_cur);
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
if inflight_max > 0 then
|
50
|
+
n = math.min(length, priority, inflight_max - inflight_cur);
|
51
|
+
else
|
52
52
|
n = math.min(length, priority);
|
53
|
-
|
53
|
+
end
|
54
54
|
|
55
55
|
-- redis.log(redis.LOG_WARNING, "PUSH: "..current.."/"..n);
|
56
56
|
|
data/lib/fairway/version.rb
CHANGED
data/redis/fairway_deliver.lua
CHANGED
@@ -23,8 +23,8 @@ for i = 1, #registered_queues, 2 do
|
|
23
23
|
local active_facets = k(queue, 'active_facets');
|
24
24
|
local round_robin = k(queue, 'facet_queue');
|
25
25
|
local facet_pool = k(queue, 'facet_pool');
|
26
|
-
|
27
|
-
|
26
|
+
local inflight_facet = k(queue, facet .. ':inflight');
|
27
|
+
local inflight_limit = k(queue, 'limit');
|
28
28
|
|
29
29
|
-- Delivering the message to a queue is as simple as
|
30
30
|
-- pushing it onto the facet's message list, and
|
@@ -35,18 +35,18 @@ for i = 1, #registered_queues, 2 do
|
|
35
35
|
-- Manage facet queue and active facets
|
36
36
|
local current = tonumber(redis.call('hget', facet_pool, facet)) or 0;
|
37
37
|
local priority = tonumber(redis.call('hget', priorities, facet)) or 1;
|
38
|
-
|
39
|
-
|
38
|
+
local inflight_cur = tonumber(redis.call('scard', inflight_facet)) or 0;
|
39
|
+
local inflight_max = tonumber(redis.call('get', inflight_limit)) or 0;
|
40
40
|
|
41
41
|
local n = 0
|
42
42
|
|
43
43
|
-- redis.log(redis.LOG_WARNING, current.."/"..length.."/"..priority.."/"..inflight_max.."/"..inflight_cur);
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
if inflight_max > 0 then
|
46
|
+
n = math.min(length, priority, inflight_max - inflight_cur);
|
47
|
+
else
|
48
48
|
n = math.min(length, priority);
|
49
|
-
|
49
|
+
end
|
50
50
|
|
51
51
|
-- redis.log(redis.LOG_WARNING, "PUSH: "..current.."/"..n);
|
52
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fairway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|