funktor 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/funktor/activity_tracker.rb +1 -2
- data/lib/funktor/incoming_job_handler.rb +2 -2
- data/lib/funktor/job_activator.rb +2 -3
- data/lib/funktor/job_pusher.rb +1 -1
- data/lib/funktor/version.rb +1 -1
- data/lib/funktor/web/application.rb +1 -1
- data/lib/funktor/work_queue_handler.rb +2 -2
- data/lib/funktor.rb +10 -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: db4cbaf6480b6d6284a6370fbe9a87826647c72485ad75728ec7e28eae541836
|
4
|
+
data.tar.gz: 9b87f5a0ca280e84c4e321a8a86fa9926d32c420382737eb37ee59ca5f0cc73e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bd98cffe465815f6aa168fc9ec81eee8c7bcda99e7d65e01116204ee55c415877b4125dc119c3ea6e8cc3d17126d123baabe06e03f7bca92112a64eb108a2fd
|
7
|
+
data.tar.gz: 86c0c79b8d031b88a623489160a04cfc3e2d115c5bf4d460011b8a6a4a3539810fb931a607f8ed27a3e9a174914671d367b3238d33aa0bf4e5da10029011f588
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
funktor (0.7.
|
4
|
+
funktor (0.7.7)
|
5
5
|
activesupport
|
6
6
|
aws-sdk-dynamodb (~> 1.62)
|
7
7
|
aws-sdk-sqs (~> 1.37)
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
addressable (2.8.0)
|
23
23
|
public_suffix (>= 2.0.2, < 5.0)
|
24
24
|
aws-eventstream (1.2.0)
|
25
|
-
aws-partitions (1.
|
25
|
+
aws-partitions (1.587.0)
|
26
26
|
aws-sdk-core (3.130.2)
|
27
27
|
aws-eventstream (~> 1, >= 1.0.2)
|
28
28
|
aws-partitions (~> 1, >= 1.525.0)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'json'
|
2
|
-
require 'aws-sdk-dynamodb'
|
3
2
|
|
4
3
|
module Funktor
|
5
4
|
class ActivityTracker
|
@@ -74,7 +73,7 @@ module Funktor
|
|
74
73
|
end
|
75
74
|
|
76
75
|
def dynamodb_client
|
77
|
-
|
76
|
+
Funktor.dynamodb_client
|
78
77
|
end
|
79
78
|
|
80
79
|
def metric_namespace
|
@@ -18,11 +18,11 @@ module Funktor
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def sqs_client
|
21
|
-
|
21
|
+
Funktor.sqs_client
|
22
22
|
end
|
23
23
|
|
24
24
|
def dynamodb_client
|
25
|
-
|
25
|
+
Funktor.dynamodb_client
|
26
26
|
end
|
27
27
|
|
28
28
|
def dispatch(job)
|
@@ -9,11 +9,11 @@ module Funktor
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def dynamodb_client
|
12
|
-
|
12
|
+
Funktor.dynamodb_client
|
13
13
|
end
|
14
14
|
|
15
15
|
def sqs_client
|
16
|
-
|
16
|
+
Funktor.sqs_client
|
17
17
|
end
|
18
18
|
|
19
19
|
def delayed_job_table
|
@@ -61,7 +61,6 @@ module Funktor
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def activate_job(job_shard, job_id, current_category, queue_immediately = false)
|
64
|
-
|
65
64
|
# TODO: WorkQueueVisibilityMiddleware to alter what happens here? Maybe we delete by default and then the middleware puts it back in the table?
|
66
65
|
# First we conditionally update the item in Dynamo to be sure that another scheduler hasn't gotten
|
67
66
|
# to it, and if that works then send to SQS. This is basically how Sidekiq scheduler works.
|
data/lib/funktor/job_pusher.rb
CHANGED
data/lib/funktor/version.rb
CHANGED
@@ -20,11 +20,11 @@ module Funktor
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def dynamodb_client
|
23
|
-
|
23
|
+
Funktor.dynamodb_client
|
24
24
|
end
|
25
25
|
|
26
26
|
def sqs_client
|
27
|
-
|
27
|
+
Funktor.sqs_client
|
28
28
|
end
|
29
29
|
|
30
30
|
def dispatch(job)
|
data/lib/funktor.rb
CHANGED
@@ -12,6 +12,8 @@ require_relative 'funktor/job_activator'
|
|
12
12
|
require_relative 'funktor/activity_tracker'
|
13
13
|
|
14
14
|
require 'json'
|
15
|
+
require 'aws-sdk-dynamodb'
|
16
|
+
require 'aws-sdk-sqs'
|
15
17
|
|
16
18
|
module Funktor
|
17
19
|
class Error < StandardError; end
|
@@ -135,6 +137,14 @@ module Funktor
|
|
135
137
|
|
136
138
|
@raw_logger = raw_logger
|
137
139
|
end
|
140
|
+
|
141
|
+
def self.dynamodb_client
|
142
|
+
@dynamodb_client ||= ::Aws::DynamoDB::Client.new
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.sqs_client
|
146
|
+
@sqs_client ||= ::Aws::SQS::Client.new
|
147
|
+
end
|
138
148
|
end
|
139
149
|
|
140
150
|
# TODO - Is it a code smell that we need to include these at the bottom, after
|