funktor 0.4.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.tool-versions +2 -0
  3. data/Gemfile.lock +24 -5
  4. data/funktor-testapp/.envrc +1 -0
  5. data/funktor-testapp/.gitignore +7 -0
  6. data/funktor-testapp/Gemfile +25 -0
  7. data/funktor-testapp/Gemfile.lock +51 -0
  8. data/funktor-testapp/app/services/job_flood.rb +38 -0
  9. data/funktor-testapp/app/workers/audit_worker.rb +49 -0
  10. data/funktor-testapp/app/workers/greetings_worker.rb +3 -0
  11. data/funktor-testapp/app/workers/hello_worker.rb +18 -0
  12. data/funktor-testapp/app/workers/single_thread_audit_worker.rb +3 -0
  13. data/funktor-testapp/deploy-dev.sh +5 -0
  14. data/funktor-testapp/funktor_config/boot.rb +17 -0
  15. data/funktor-testapp/funktor_config/environment.yml +15 -0
  16. data/funktor-testapp/funktor_config/function_definitions/default_queue_handler.yml +13 -0
  17. data/funktor-testapp/funktor_config/function_definitions/incoming_job_handler.yml +13 -0
  18. data/funktor-testapp/funktor_config/function_definitions/job_activator.yml +7 -0
  19. data/funktor-testapp/funktor_config/function_definitions/low_concurrency_queue_handler.yml +13 -0
  20. data/funktor-testapp/funktor_config/function_definitions/random_job_generator.yml +18 -0
  21. data/funktor-testapp/funktor_config/funktor.yml +114 -0
  22. data/funktor-testapp/funktor_config/iam_permissions/activity_table.yml +5 -0
  23. data/funktor-testapp/funktor_config/iam_permissions/default_queue.yml +8 -0
  24. data/funktor-testapp/funktor_config/iam_permissions/incoming_job_queue.yml +8 -0
  25. data/funktor-testapp/funktor_config/iam_permissions/jobs_table.yml +5 -0
  26. data/funktor-testapp/funktor_config/iam_permissions/jobs_table_secondary_index.yml +8 -0
  27. data/funktor-testapp/funktor_config/iam_permissions/low_concurrency_queue.yml +8 -0
  28. data/funktor-testapp/funktor_config/iam_permissions/ssm.yml +5 -0
  29. data/funktor-testapp/funktor_config/package.yml +11 -0
  30. data/funktor-testapp/funktor_config/resources/activity_table.yml +22 -0
  31. data/funktor-testapp/funktor_config/resources/cloudwatch_dashboard.yml +809 -0
  32. data/funktor-testapp/funktor_config/resources/default_queue.yml +22 -0
  33. data/funktor-testapp/funktor_config/resources/incoming_job_queue.yml +22 -0
  34. data/funktor-testapp/funktor_config/resources/incoming_job_queue_user.yml +26 -0
  35. data/funktor-testapp/funktor_config/resources/jobs_table.yml +56 -0
  36. data/funktor-testapp/funktor_config/resources/low_concurrency_queue.yml +22 -0
  37. data/funktor-testapp/funktor_config/ruby_layer.yml +11 -0
  38. data/funktor-testapp/funktor_init.yml +69 -0
  39. data/funktor-testapp/lambda_event_handlers/default_queue_handler.rb +8 -0
  40. data/funktor-testapp/lambda_event_handlers/incoming_job_handler.rb +8 -0
  41. data/funktor-testapp/lambda_event_handlers/job_activator.rb +8 -0
  42. data/funktor-testapp/lambda_event_handlers/low_concurrency_queue_handler.rb +8 -0
  43. data/funktor-testapp/lambda_event_handlers/random_job_generator.rb +35 -0
  44. data/funktor-testapp/package-lock.json +248 -0
  45. data/funktor-testapp/package.json +8 -0
  46. data/funktor-testapp/serverless.yml +66 -0
  47. data/funktor.gemspec +4 -1
  48. data/lib/active_job/queue_adapters/funktor_adapter.rb +3 -3
  49. data/lib/funktor/activity_tracker.rb +106 -0
  50. data/lib/funktor/cli/bootstrap.rb +0 -1
  51. data/lib/funktor/cli/init.rb +13 -0
  52. data/lib/funktor/cli/templates/app/workers/hello_worker.rb +1 -1
  53. data/lib/funktor/cli/templates/funktor_config/environment.yml +4 -0
  54. data/lib/funktor/cli/templates/funktor_config/function_definitions/incoming_job_handler.yml +3 -1
  55. data/lib/funktor/cli/templates/funktor_config/function_definitions/job_activator.yml +7 -0
  56. data/lib/funktor/cli/templates/funktor_config/function_definitions/work_queue_handler.yml +3 -1
  57. data/lib/funktor/cli/templates/funktor_config/funktor.yml +32 -6
  58. data/lib/funktor/cli/templates/funktor_config/iam_permissions/activity_table.yml +5 -0
  59. data/lib/funktor/cli/templates/funktor_config/iam_permissions/jobs_table.yml +5 -0
  60. data/lib/funktor/cli/templates/funktor_config/iam_permissions/jobs_table_secondary_index.yml +8 -0
  61. data/lib/funktor/cli/templates/funktor_config/resources/activity_table.yml +22 -0
  62. data/lib/funktor/cli/templates/funktor_config/resources/cloudwatch_dashboard.yml +13 -12
  63. data/lib/funktor/cli/templates/funktor_config/resources/incoming_job_queue.yml +2 -2
  64. data/lib/funktor/cli/templates/funktor_config/resources/jobs_table.yml +56 -0
  65. data/lib/funktor/cli/templates/funktor_config/resources/work_queue.yml +2 -2
  66. data/lib/funktor/cli/templates/funktor_init.yml.tt +16 -16
  67. data/lib/funktor/cli/templates/lambda_event_handlers/job_activator.rb +8 -0
  68. data/lib/funktor/cli/templates/lambda_event_handlers/work_queue_handler.rb +1 -1
  69. data/lib/funktor/cli/templates/serverless.yml +3 -2
  70. data/lib/funktor/counter.rb +4 -1
  71. data/lib/funktor/incoming_job_handler.rb +54 -18
  72. data/lib/funktor/job.rb +57 -7
  73. data/lib/funktor/job_activator.rb +124 -0
  74. data/lib/funktor/job_pusher.rb +0 -2
  75. data/lib/funktor/middleware/metrics.rb +8 -3
  76. data/lib/funktor/shard_utils.rb +6 -0
  77. data/lib/funktor/testing.rb +52 -29
  78. data/lib/funktor/version.rb +1 -1
  79. data/lib/funktor/web/application.rb +139 -0
  80. data/lib/funktor/web/views/index.erb +3 -0
  81. data/lib/funktor/web/views/layout.erb +58 -0
  82. data/lib/funktor/web/views/processing.erb +29 -0
  83. data/lib/funktor/web/views/queued.erb +29 -0
  84. data/lib/funktor/web/views/retries.erb +35 -0
  85. data/lib/funktor/web/views/scheduled.erb +26 -0
  86. data/lib/funktor/web/views/stats.erb +9 -0
  87. data/lib/funktor/web/views/table_stats_with_buttons.erb +11 -0
  88. data/lib/funktor/web.rb +1 -0
  89. data/lib/funktor/work_queue_handler.rb +101 -0
  90. data/lib/funktor/worker/funktor_options.rb +3 -1
  91. data/lib/funktor/worker.rb +8 -18
  92. data/lib/funktor.rb +52 -20
  93. metadata +109 -3
  94. data/lib/funktor/active_job_handler.rb +0 -58
@@ -0,0 +1,29 @@
1
+ <h1>Processing</h1>
2
+ <p>Showing <%= jobs.count %> of <%= @activity_stats["processing"] %></p>
3
+ <table role="grid">
4
+ <tr>
5
+ <td>ID</td>
6
+ <td>Perform at</td>
7
+ <td>Worker</td>
8
+ <td>Queue</td>
9
+ <td>Params</td>
10
+ <td>Attempts</td>
11
+ <td>Last error</td>
12
+ </tr>
13
+ <% jobs.each do |job| %>
14
+ <tr>
15
+ <td><%= job.job_id %></td>
16
+ <td><%= job.perform_at %></td>
17
+ <td><%= job.worker_class_name %></td>
18
+ <td><%= job.queue %></td>
19
+ <td><%= job.worker_params %></td>
20
+ <td><%= job.retries %></td>
21
+ <td>
22
+ <%= job.error_class %> - <%= job.error_message %>
23
+ <br/>
24
+ <%= job.error_backtrace.first %>
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ </table>
29
+
@@ -0,0 +1,29 @@
1
+ <h1>Queued</h1>
2
+ <p>Showing <%= jobs.count %> of <%= @activity_stats["queued"] %></p>
3
+ <table role="grid">
4
+ <tr>
5
+ <td>ID</td>
6
+ <td>Perform at</td>
7
+ <td>Worker</td>
8
+ <td>Queue</td>
9
+ <td>Params</td>
10
+ <td>Attempts</td>
11
+ <td>Last error</td>
12
+ </tr>
13
+ <% jobs.each do |job| %>
14
+ <tr>
15
+ <td><%= job.job_id %></td>
16
+ <td><%= job.perform_at %></td>
17
+ <td><%= job.worker_class_name %></td>
18
+ <td><%= job.queue %></td>
19
+ <td><%= job.worker_params %></td>
20
+ <td><%= job.retries %></td>
21
+ <td>
22
+ <%= job.error_class %> - <%= job.error_message %>
23
+ <br/>
24
+ <%= job.error_backtrace.first %>
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ </table>
29
+
@@ -0,0 +1,35 @@
1
+ <h1>Retries</h1>
2
+ <form action="/update_jobs" method="post" accept-charset="utf-8">
3
+ <input type="hidden" name="source" value="retry" />
4
+ <%= erb :table_stats_with_buttons, locals: { jobs: jobs, stat_category: 'retries' } %>
5
+ <table role="grid">
6
+ <tr>
7
+ <td>&nbsp;</td>
8
+ <td>ID</td>
9
+ <td>Perform at</td>
10
+ <td>Worker</td>
11
+ <td>Queue</td>
12
+ <td>Params</td>
13
+ <td>Attempts</td>
14
+ <td>Last error</td>
15
+ </tr>
16
+ <% jobs.each do |job| %>
17
+ <tr>
18
+ <td><input type="checkbox" name="job_id[]" value="<%= job.job_id %>" id=""></td>
19
+ <td><%= job.job_id %></td>
20
+ <td><%= job.perform_at %></td>
21
+ <td><%= job.worker_class_name %></td>
22
+ <td><%= job.queue %></td>
23
+ <td><%= job.worker_params %></td>
24
+ <td><%= job.retries %></td>
25
+ <td>
26
+ <%= job.error_class %> - <%= job.error_message %>
27
+ <br/>
28
+ <%= job.error_backtrace.first %>
29
+ </td>
30
+ </tr>
31
+ <% end %>
32
+ </table>
33
+ <%= erb :table_stats_with_buttons, locals: { jobs: jobs, stat_category: 'retries' } %>
34
+ </form>
35
+
@@ -0,0 +1,26 @@
1
+ <h1>Scheduled</h1>
2
+ <form action="/update_jobs" method="post" accept-charset="utf-8">
3
+ <input type="hidden" name="source" value="scheduled" />
4
+ <%= erb :table_stats_with_buttons, locals: { jobs: jobs, stat_category: 'scheduled' } %>
5
+ <table role="grid">
6
+ <tr>
7
+ <td>&nbsp;</td>
8
+ <td>ID</td>
9
+ <td>Perform at</td>
10
+ <td>Worker</td>
11
+ <td>Queue</td>
12
+ <td>Params</td>
13
+ </tr>
14
+ <% jobs.each do |job| %>
15
+ <tr>
16
+ <td><input type="checkbox" name="job_id[]" value="<%= job.job_id %>" id=""></td>
17
+ <td><%= job.job_id %></td>
18
+ <td><%= job.perform_at %></td>
19
+ <td><%= job.worker_class_name %></td>
20
+ <td><%= job.queue %></td>
21
+ <td><%= job.worker_params %></td>
22
+ </tr>
23
+ <% end %>
24
+ </table>
25
+ <%= erb :table_stats_with_buttons, locals: { jobs: jobs, stat_category: 'scheduled' } %>
26
+ </form>
@@ -0,0 +1,9 @@
1
+ <table class="header">
2
+ <tr>
3
+ <td><h5>Funktor</h5></td>
4
+ <% @activity_stats.each_pair do |stat, value| %>
5
+ <td><a href="/<%= stat %>"><%= stat %>: <%= value %></a></td>
6
+ <% end %>
7
+ <td>Current time UTC: <%= Time.now.utc %></td>
8
+ </tr>
9
+ </table>
@@ -0,0 +1,11 @@
1
+ <div class="grid">
2
+ <div>
3
+ Showing <%= jobs.count %> of <%= @activity_stats[stat_category] %>
4
+ </div>
5
+ <div>
6
+ <input type="submit" name="submit" value="Delete Selected Jobs" />
7
+ </div>
8
+ <div>
9
+ <input type="submit" name="submit" value="Queue Selected Jobs" />
10
+ </div>
11
+ </div>
@@ -0,0 +1 @@
1
+ include 'funktor/web/application'
@@ -0,0 +1,101 @@
1
+ require 'aws-sdk-sqs'
2
+ require 'aws-sdk-dynamodb'
3
+
4
+ module Funktor
5
+ class WorkQueueHandler
6
+ include Funktor::ErrorHandler
7
+
8
+ def initialize
9
+ @failed_counter = Funktor::Counter.new('failed')
10
+ @processed_counter = Funktor::Counter.new('processed')
11
+ @tracker = Funktor::ActivityTracker.new
12
+ end
13
+
14
+ def call(event:, context:)
15
+ event = Funktor::Aws::Sqs::Event.new(event)
16
+ Funktor.logger.debug "event.jobs.count = #{event.jobs.count}"
17
+ event.jobs.each do |job|
18
+ dispatch(job)
19
+ end
20
+ end
21
+
22
+ def dynamodb_client
23
+ @dynamodb_client ||= ::Aws::DynamoDB::Client.new
24
+ end
25
+
26
+ def sqs_client
27
+ @sqs_client ||= ::Aws::SQS::Client.new
28
+ end
29
+
30
+ def dispatch(job)
31
+ begin
32
+ @tracker.track(:processingStarted, job)
33
+ update_job_category(job, "processing")
34
+ Funktor.work_queue_handler_middleware.invoke(job) do
35
+ job.execute
36
+ end
37
+ @processed_counter.incr(job)
38
+ @tracker.track(:processingComplete, job)
39
+ delete_job_from_dynamodb(job)
40
+ # rescue Funktor::Job::InvalidJsonError # TODO Make this work
41
+ rescue Exception => e
42
+ handle_error(e, job)
43
+ @failed_counter.incr(job)
44
+ job.error = e
45
+ if job.can_retry
46
+ @tracker.track(:retrying, job)
47
+ update_job_category(job, "retry")
48
+ trigger_retry(job)
49
+ else
50
+ @tracker.track(:bailingOut, job)
51
+ update_job_category(job, "dead")
52
+ Funktor.logger.error "We retried max times. We're bailing on this one."
53
+ Funktor.logger.error job.to_json
54
+ end
55
+ @tracker.track(:processingFailed, job)
56
+ end
57
+ end
58
+
59
+ def trigger_retry(job)
60
+ job.increment_retries
61
+ Funktor.logger.error "scheduling retry # #{job.retries} with delay of #{job.delay}"
62
+ Funktor.logger.error job.to_json
63
+ sqs_client.send_message({
64
+ queue_url: job.retry_queue_url,
65
+ message_body: job.to_json
66
+ })
67
+ end
68
+
69
+ def delayed_job_table
70
+ ENV['FUNKTOR_JOBS_TABLE']
71
+ end
72
+
73
+ def update_job_category(job, category)
74
+ dynamodb_client.update_item({
75
+ key: {
76
+ "jobShard" => job.shard,
77
+ "jobId" => job.job_id
78
+ },
79
+ table_name: delayed_job_table,
80
+ update_expression: "SET category = :category, queueable = :queueable",
81
+ expression_attribute_values: {
82
+ ":queueable" => "false",
83
+ ":category" => category
84
+ },
85
+ return_values: "ALL_OLD"
86
+ })
87
+ end
88
+
89
+ def delete_job_from_dynamodb(job)
90
+ dynamodb_client.delete_item({
91
+ key: {
92
+ "jobShard" => job.shard,
93
+ "jobId" => job.job_id
94
+ },
95
+ table_name: delayed_job_table,
96
+ return_values: "ALL_OLD"
97
+ })
98
+ end
99
+
100
+ end
101
+ end
@@ -1,10 +1,12 @@
1
+ require 'active_support/core_ext/class/attribute'
2
+
1
3
  module Funktor
2
4
  module Worker
3
5
  module FunktorOptions
4
6
  def self.included(base)
5
7
  base.extend ClassMethods
6
8
  base.class_eval do
7
- cattr_accessor :funktor_options_hash
9
+ class_attribute :funktor_options_hash
8
10
  end
9
11
  end
10
12
  module ClassMethods
@@ -18,37 +18,27 @@ module Funktor::Worker
18
18
  self.perform_in(0, *worker_params)
19
19
  end
20
20
 
21
- def perform_at(time, *worker_params)
22
- delay = (time.utc - Time.now.utc).round
23
- if delay < 0
24
- delay = 0
25
- end
26
- self.perform_in(delay, *worker_params)
21
+ def perform_at(job_time, *worker_params)
22
+ self.push(job_time, *worker_params)
27
23
  end
28
24
 
29
25
  def perform_in(delay, *worker_params)
30
- if delay > max_delay
31
- raise Funktor::DelayTooLongError.new("The delay can't be longer than #{max_delay} seconds. This is a limitation of SQS. Funktor Pro has mechanisms to work around this limitation.")
32
- end
33
- self.push(delay, *worker_params)
26
+ job_time = Time.now.utc + delay
27
+ self.perform_at(job_time, *worker_params)
34
28
  end
35
29
 
36
- def push(delay, *worker_params)
37
- payload = build_job_payload(delay, *worker_params)
30
+ def push(job_time, *worker_params)
31
+ payload = build_job_payload(job_time, *worker_params)
38
32
  Funktor.job_pusher.push(payload)
39
33
  end
40
34
 
41
- def max_delay
42
- 900
43
- end
44
-
45
- def build_job_payload(delay, *worker_params)
35
+ def build_job_payload(job_time, *worker_params)
46
36
  {
47
37
  worker: self.name,
48
38
  worker_params: worker_params,
49
39
  queue: self.work_queue,
50
40
  incoming_job_queue_url: self.queue_url,
51
- delay: delay,
41
+ perform_at: job_time.utc,
52
42
  funktor_options: get_funktor_options
53
43
  }
54
44
  end
data/lib/funktor.rb CHANGED
@@ -1,13 +1,15 @@
1
- require "funktor/version"
2
- require 'funktor/aws/sqs/event'
3
- require 'funktor/aws/sqs/record'
4
- require 'funktor/counter'
5
- require 'funktor/job'
6
- require 'funktor/job_pusher'
7
- require 'funktor/logger'
8
- require 'funktor/worker'
9
- require 'funktor/middleware_chain'
10
- require 'funktor/incoming_job_handler'
1
+ require_relative "funktor/version"
2
+ require_relative 'funktor/aws/sqs/event'
3
+ require_relative 'funktor/aws/sqs/record'
4
+ require_relative 'funktor/counter'
5
+ require_relative 'funktor/job'
6
+ require_relative 'funktor/job_pusher'
7
+ require_relative 'funktor/logger'
8
+ require_relative 'funktor/worker'
9
+ require_relative 'funktor/middleware_chain'
10
+ require_relative 'funktor/incoming_job_handler'
11
+ require_relative 'funktor/job_activator'
12
+ require_relative 'funktor/activity_tracker'
11
13
 
12
14
  require 'json'
13
15
 
@@ -33,14 +35,14 @@ module Funktor
33
35
  @job_pusher_chain
34
36
  end
35
37
 
36
- def self.configure_active_job_handler
38
+ def self.configure_work_queue_handler
37
39
  yield self
38
40
  end
39
41
 
40
- def self.active_job_handler_middleware
41
- @active_job_handler_chain ||= MiddlewareChain.new
42
- yield @active_job_handler_chain if block_given?
43
- @active_job_handler_chain
42
+ def self.work_queue_handler_middleware
43
+ @work_queue_handler_chain ||= MiddlewareChain.new
44
+ yield @work_queue_handler_chain if block_given?
45
+ @work_queue_handler_chain
44
46
  end
45
47
 
46
48
  # TODO - Maybe we don't need this either? Maybe this should be a super dumb thing that also
@@ -58,6 +60,18 @@ module Funktor
58
60
  @incoming_job_handler_chain
59
61
  end
60
62
 
63
+ # TODO - Does this actually make any sense? Should the JobActivator even know about
64
+ # jobs/classes? Maybe it should be super dumb and just push JSON blobs around?
65
+ def self.configure_job_activator
66
+ yield self
67
+ end
68
+
69
+ def self.job_activator_middleware
70
+ @job_activator_chain ||= MiddlewareChain.new
71
+ yield @job_activator_chain if block_given?
72
+ @job_activator_chain
73
+ end
74
+
61
75
  def self.parse_json(string)
62
76
  JSON.parse(string)
63
77
  end
@@ -95,13 +109,31 @@ module Funktor
95
109
 
96
110
  @logger = logger
97
111
  end
112
+
113
+ # We have a raw_logger that doesn't add timestamps and what not. This is used to publish
114
+ # CloudWatch metrics that can be used in dashboards.
115
+ def self.raw_logger
116
+ @raw_logger ||= Funktor::Logger.new($stdout, level: options[:log_level], formatter: proc {|severity, datetime, progname, msg|
117
+ "#{msg}\n"
118
+ })
119
+ end
120
+
121
+ def self.raw_logger=(raw_logger)
122
+ if raw_logger.nil?
123
+ self.raw_logger.level = Logger::FATAL
124
+ return self.raw_logger
125
+ end
126
+
127
+ @raw_logger = raw_logger
128
+ end
98
129
  end
99
130
 
100
- # TODO - Should we require this by default or let people opt in?
101
131
  # TODO - Is it a code smell that we need to include these at the bottom, after
102
132
  # the main Funktor module is defined?
103
- require 'funktor/middleware/metrics'
104
- require 'funktor/error_handler'
105
- require 'funktor/active_job_handler'
133
+ #
134
+ # TODO - Should we require metrics by default or let people opt in?
135
+ require_relative 'funktor/middleware/metrics'
136
+ require_relative 'funktor/error_handler'
137
+ require_relative 'funktor/work_queue_handler'
106
138
 
107
- require 'funktor/rails' if defined?(::Rails::Engine)
139
+ require_relative 'funktor/rails' if defined?(::Rails::Engine)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.37'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-dynamodb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.62'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.62'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: activesupport
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +122,34 @@ dependencies:
108
122
  - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sinatra
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: timecop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
111
153
  description: Background processing in AWS Lambda.
112
154
  email:
113
155
  - jeremy@octolabs.com
@@ -120,6 +162,7 @@ files:
120
162
  - ".github/workflows/ruby.yml"
121
163
  - ".gitignore"
122
164
  - ".rspec"
165
+ - ".tool-versions"
123
166
  - ".travis.yml"
124
167
  - CODE_OF_CONDUCT.md
125
168
  - Gemfile
@@ -131,10 +174,53 @@ files:
131
174
  - bin/setup
132
175
  - exe/funktor
133
176
  - exe/funktor-deploy
177
+ - funktor-testapp/.envrc
178
+ - funktor-testapp/.gitignore
179
+ - funktor-testapp/Gemfile
180
+ - funktor-testapp/Gemfile.lock
181
+ - funktor-testapp/app/services/job_flood.rb
182
+ - funktor-testapp/app/workers/audit_worker.rb
183
+ - funktor-testapp/app/workers/greetings_worker.rb
184
+ - funktor-testapp/app/workers/hello_worker.rb
185
+ - funktor-testapp/app/workers/single_thread_audit_worker.rb
186
+ - funktor-testapp/deploy-dev.sh
187
+ - funktor-testapp/funktor_config/boot.rb
188
+ - funktor-testapp/funktor_config/environment.yml
189
+ - funktor-testapp/funktor_config/function_definitions/default_queue_handler.yml
190
+ - funktor-testapp/funktor_config/function_definitions/incoming_job_handler.yml
191
+ - funktor-testapp/funktor_config/function_definitions/job_activator.yml
192
+ - funktor-testapp/funktor_config/function_definitions/low_concurrency_queue_handler.yml
193
+ - funktor-testapp/funktor_config/function_definitions/random_job_generator.yml
194
+ - funktor-testapp/funktor_config/funktor.yml
195
+ - funktor-testapp/funktor_config/iam_permissions/activity_table.yml
196
+ - funktor-testapp/funktor_config/iam_permissions/default_queue.yml
197
+ - funktor-testapp/funktor_config/iam_permissions/incoming_job_queue.yml
198
+ - funktor-testapp/funktor_config/iam_permissions/jobs_table.yml
199
+ - funktor-testapp/funktor_config/iam_permissions/jobs_table_secondary_index.yml
200
+ - funktor-testapp/funktor_config/iam_permissions/low_concurrency_queue.yml
201
+ - funktor-testapp/funktor_config/iam_permissions/ssm.yml
202
+ - funktor-testapp/funktor_config/package.yml
203
+ - funktor-testapp/funktor_config/resources/activity_table.yml
204
+ - funktor-testapp/funktor_config/resources/cloudwatch_dashboard.yml
205
+ - funktor-testapp/funktor_config/resources/default_queue.yml
206
+ - funktor-testapp/funktor_config/resources/incoming_job_queue.yml
207
+ - funktor-testapp/funktor_config/resources/incoming_job_queue_user.yml
208
+ - funktor-testapp/funktor_config/resources/jobs_table.yml
209
+ - funktor-testapp/funktor_config/resources/low_concurrency_queue.yml
210
+ - funktor-testapp/funktor_config/ruby_layer.yml
211
+ - funktor-testapp/funktor_init.yml
212
+ - funktor-testapp/lambda_event_handlers/default_queue_handler.rb
213
+ - funktor-testapp/lambda_event_handlers/incoming_job_handler.rb
214
+ - funktor-testapp/lambda_event_handlers/job_activator.rb
215
+ - funktor-testapp/lambda_event_handlers/low_concurrency_queue_handler.rb
216
+ - funktor-testapp/lambda_event_handlers/random_job_generator.rb
217
+ - funktor-testapp/package-lock.json
218
+ - funktor-testapp/package.json
219
+ - funktor-testapp/serverless.yml
134
220
  - funktor.gemspec
135
221
  - lib/active_job/queue_adapters/funktor_adapter.rb
136
222
  - lib/funktor.rb
137
- - lib/funktor/active_job_handler.rb
223
+ - lib/funktor/activity_tracker.rb
138
224
  - lib/funktor/aws/sqs/event.rb
139
225
  - lib/funktor/aws/sqs/record.rb
140
226
  - lib/funktor/cli/application.rb
@@ -148,20 +234,27 @@ files:
148
234
  - lib/funktor/cli/templates/funktor_config/boot.rb
149
235
  - lib/funktor/cli/templates/funktor_config/environment.yml
150
236
  - lib/funktor/cli/templates/funktor_config/function_definitions/incoming_job_handler.yml
237
+ - lib/funktor/cli/templates/funktor_config/function_definitions/job_activator.yml
151
238
  - lib/funktor/cli/templates/funktor_config/function_definitions/work_queue_handler.yml
152
239
  - lib/funktor/cli/templates/funktor_config/funktor.yml
240
+ - lib/funktor/cli/templates/funktor_config/iam_permissions/activity_table.yml
153
241
  - lib/funktor/cli/templates/funktor_config/iam_permissions/incoming_job_queue.yml
242
+ - lib/funktor/cli/templates/funktor_config/iam_permissions/jobs_table.yml
243
+ - lib/funktor/cli/templates/funktor_config/iam_permissions/jobs_table_secondary_index.yml
154
244
  - lib/funktor/cli/templates/funktor_config/iam_permissions/ssm.yml
155
245
  - lib/funktor/cli/templates/funktor_config/iam_permissions/work_queue.yml
156
246
  - lib/funktor/cli/templates/funktor_config/package.yml
247
+ - lib/funktor/cli/templates/funktor_config/resources/activity_table.yml
157
248
  - lib/funktor/cli/templates/funktor_config/resources/cloudwatch_dashboard.yml
158
249
  - lib/funktor/cli/templates/funktor_config/resources/incoming_job_queue.yml
159
250
  - lib/funktor/cli/templates/funktor_config/resources/incoming_job_queue_user.yml
251
+ - lib/funktor/cli/templates/funktor_config/resources/jobs_table.yml
160
252
  - lib/funktor/cli/templates/funktor_config/resources/work_queue.yml
161
253
  - lib/funktor/cli/templates/funktor_config/ruby_layer.yml
162
254
  - lib/funktor/cli/templates/funktor_init.yml.tt
163
255
  - lib/funktor/cli/templates/gitignore
164
256
  - lib/funktor/cli/templates/lambda_event_handlers/incoming_job_handler.rb
257
+ - lib/funktor/cli/templates/lambda_event_handlers/job_activator.rb
165
258
  - lib/funktor/cli/templates/lambda_event_handlers/work_queue_handler.rb
166
259
  - lib/funktor/cli/templates/package.json
167
260
  - lib/funktor/cli/templates/serverless.yml
@@ -170,13 +263,26 @@ files:
170
263
  - lib/funktor/fake_job_queue.rb
171
264
  - lib/funktor/incoming_job_handler.rb
172
265
  - lib/funktor/job.rb
266
+ - lib/funktor/job_activator.rb
173
267
  - lib/funktor/job_pusher.rb
174
268
  - lib/funktor/logger.rb
175
269
  - lib/funktor/middleware/metrics.rb
176
270
  - lib/funktor/middleware_chain.rb
177
271
  - lib/funktor/rails.rb
272
+ - lib/funktor/shard_utils.rb
178
273
  - lib/funktor/testing.rb
179
274
  - lib/funktor/version.rb
275
+ - lib/funktor/web.rb
276
+ - lib/funktor/web/application.rb
277
+ - lib/funktor/web/views/index.erb
278
+ - lib/funktor/web/views/layout.erb
279
+ - lib/funktor/web/views/processing.erb
280
+ - lib/funktor/web/views/queued.erb
281
+ - lib/funktor/web/views/retries.erb
282
+ - lib/funktor/web/views/scheduled.erb
283
+ - lib/funktor/web/views/stats.erb
284
+ - lib/funktor/web/views/table_stats_with_buttons.erb
285
+ - lib/funktor/work_queue_handler.rb
180
286
  - lib/funktor/worker.rb
181
287
  - lib/funktor/worker/funktor_options.rb
182
288
  homepage: https://github.com/Octo-Labs/funktor