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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00c5852fd10c7e6ad87b576ff0a1ed13b62f69fc19391202d4c2d289376a3fb2
4
- data.tar.gz: e780ae7466a2c4dfc7060abfacd230a9284105c89aa95db376e99b7fe14a2b89
3
+ metadata.gz: db4cbaf6480b6d6284a6370fbe9a87826647c72485ad75728ec7e28eae541836
4
+ data.tar.gz: 9b87f5a0ca280e84c4e321a8a86fa9926d32c420382737eb37ee59ca5f0cc73e
5
5
  SHA512:
6
- metadata.gz: e7015cc189689fbffb456727899417e1edb7f823436536b6a3f316a96a83291bdaf0ee43b860d2925b53c239be15d685df268bf277c0843efc853b2b07abe0d6
7
- data.tar.gz: a8d58b3d8d45b5bd2ecd70c1f18956685af350959cd6d3263e212d611e9e4d7d069b52681866e725cc432af09a434465e0b9bff80dc94d7a444f88d21a87a36d
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.5)
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.584.0)
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
- @dynamodb_client ||= ::Aws::DynamoDB::Client.new
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
- @sqs_client ||= ::Aws::SQS::Client.new
21
+ Funktor.sqs_client
22
22
  end
23
23
 
24
24
  def dynamodb_client
25
- @dynamodb_client ||= ::Aws::DynamoDB::Client.new
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
- @dynamodb_client ||= ::Aws::DynamoDB::Client.new
12
+ Funktor.dynamodb_client
13
13
  end
14
14
 
15
15
  def sqs_client
16
- @sqs_client ||= ::Aws::SQS::Client.new
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.
@@ -19,7 +19,7 @@ module Funktor
19
19
  private
20
20
 
21
21
  def client
22
- @client ||= ::Aws::SQS::Client.new
22
+ Funktor.sqs_client
23
23
  end
24
24
 
25
25
  def queue_url(payload)
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.7.6"
2
+ VERSION = "0.7.7"
3
3
  end
@@ -128,7 +128,7 @@ module Funktor
128
128
  end
129
129
 
130
130
  def dynamodb_client
131
- @dynamodb_client ||= ::Aws::DynamoDB::Client.new
131
+ Funktor.dynamodb_client
132
132
  end
133
133
 
134
134
  # start the server if ruby file executed directly
@@ -20,11 +20,11 @@ module Funktor
20
20
  end
21
21
 
22
22
  def dynamodb_client
23
- @dynamodb_client ||= ::Aws::DynamoDB::Client.new
23
+ Funktor.dynamodb_client
24
24
  end
25
25
 
26
26
  def sqs_client
27
- @sqs_client ||= ::Aws::SQS::Client.new
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green