jobi 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +5 -0
  7. data/CHANGELOG.md +14 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +10 -0
  10. data/Gemfile.lock +45 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +132 -0
  13. data/Rakefile +6 -0
  14. data/bin/console +14 -0
  15. data/bin/jobi.log +31 -0
  16. data/bin/setup +8 -0
  17. data/examples/demo_app/.browserslistrc +1 -0
  18. data/examples/demo_app/.gitignore +35 -0
  19. data/examples/demo_app/.ruby-version +1 -0
  20. data/examples/demo_app/Gemfile +56 -0
  21. data/examples/demo_app/Gemfile.lock +237 -0
  22. data/examples/demo_app/README.md +24 -0
  23. data/examples/demo_app/Rakefile +6 -0
  24. data/examples/demo_app/app/assets/config/manifest.js +2 -0
  25. data/examples/demo_app/app/assets/images/.keep +0 -0
  26. data/examples/demo_app/app/assets/stylesheets/application.css +15 -0
  27. data/examples/demo_app/app/assets/stylesheets/home.scss +3 -0
  28. data/examples/demo_app/app/channels/application_cable/channel.rb +4 -0
  29. data/examples/demo_app/app/channels/application_cable/connection.rb +4 -0
  30. data/examples/demo_app/app/controllers/application_controller.rb +2 -0
  31. data/examples/demo_app/app/controllers/concerns/.keep +0 -0
  32. data/examples/demo_app/app/controllers/home_controller.rb +6 -0
  33. data/examples/demo_app/app/helpers/application_helper.rb +2 -0
  34. data/examples/demo_app/app/helpers/home_helper.rb +2 -0
  35. data/examples/demo_app/app/javascript/channels/consumer.js +6 -0
  36. data/examples/demo_app/app/javascript/channels/index.js +5 -0
  37. data/examples/demo_app/app/javascript/packs/application.js +17 -0
  38. data/examples/demo_app/app/jobs/application_job.rb +7 -0
  39. data/examples/demo_app/app/jobs/calculator_job.rb +14 -0
  40. data/examples/demo_app/app/mailers/application_mailer.rb +4 -0
  41. data/examples/demo_app/app/models/application_record.rb +3 -0
  42. data/examples/demo_app/app/models/concerns/.keep +0 -0
  43. data/examples/demo_app/app/views/layouts/application.html.erb +15 -0
  44. data/examples/demo_app/app/views/layouts/mailer.html.erb +13 -0
  45. data/examples/demo_app/app/views/layouts/mailer.text.erb +1 -0
  46. data/examples/demo_app/babel.config.js +72 -0
  47. data/examples/demo_app/bin/bundle +114 -0
  48. data/examples/demo_app/bin/rails +9 -0
  49. data/examples/demo_app/bin/rake +9 -0
  50. data/examples/demo_app/bin/setup +36 -0
  51. data/examples/demo_app/bin/spring +17 -0
  52. data/examples/demo_app/bin/webpack +18 -0
  53. data/examples/demo_app/bin/webpack-dev-server +18 -0
  54. data/examples/demo_app/bin/yarn +11 -0
  55. data/examples/demo_app/config.ru +5 -0
  56. data/examples/demo_app/config/application.rb +19 -0
  57. data/examples/demo_app/config/boot.rb +4 -0
  58. data/examples/demo_app/config/cable.yml +10 -0
  59. data/examples/demo_app/config/credentials.yml.enc +1 -0
  60. data/examples/demo_app/config/database.yml +25 -0
  61. data/examples/demo_app/config/environment.rb +5 -0
  62. data/examples/demo_app/config/environments/development.rb +62 -0
  63. data/examples/demo_app/config/environments/production.rb +112 -0
  64. data/examples/demo_app/config/environments/test.rb +48 -0
  65. data/examples/demo_app/config/initializers/application_controller_renderer.rb +8 -0
  66. data/examples/demo_app/config/initializers/assets.rb +14 -0
  67. data/examples/demo_app/config/initializers/backtrace_silencers.rb +7 -0
  68. data/examples/demo_app/config/initializers/content_security_policy.rb +30 -0
  69. data/examples/demo_app/config/initializers/cookies_serializer.rb +5 -0
  70. data/examples/demo_app/config/initializers/filter_parameter_logging.rb +4 -0
  71. data/examples/demo_app/config/initializers/inflections.rb +16 -0
  72. data/examples/demo_app/config/initializers/jobi.rb +8 -0
  73. data/examples/demo_app/config/initializers/mime_types.rb +4 -0
  74. data/examples/demo_app/config/initializers/wrap_parameters.rb +14 -0
  75. data/examples/demo_app/config/locales/en.yml +33 -0
  76. data/examples/demo_app/config/puma.rb +38 -0
  77. data/examples/demo_app/config/routes.rb +4 -0
  78. data/examples/demo_app/config/spring.rb +6 -0
  79. data/examples/demo_app/config/storage.yml +34 -0
  80. data/examples/demo_app/config/webpack/development.js +5 -0
  81. data/examples/demo_app/config/webpack/environment.js +3 -0
  82. data/examples/demo_app/config/webpack/production.js +5 -0
  83. data/examples/demo_app/config/webpack/test.js +5 -0
  84. data/examples/demo_app/config/webpacker.yml +96 -0
  85. data/examples/demo_app/db/seeds.rb +7 -0
  86. data/examples/demo_app/lib/assets/.keep +0 -0
  87. data/examples/demo_app/lib/tasks/.keep +0 -0
  88. data/examples/demo_app/log/.keep +0 -0
  89. data/examples/demo_app/package.json +15 -0
  90. data/examples/demo_app/postcss.config.js +12 -0
  91. data/examples/demo_app/public/404.html +67 -0
  92. data/examples/demo_app/public/422.html +67 -0
  93. data/examples/demo_app/public/500.html +66 -0
  94. data/examples/demo_app/public/apple-touch-icon-precomposed.png +0 -0
  95. data/examples/demo_app/public/apple-touch-icon.png +0 -0
  96. data/examples/demo_app/public/favicon.ico +0 -0
  97. data/examples/demo_app/public/robots.txt +1 -0
  98. data/examples/demo_app/storage/.keep +0 -0
  99. data/examples/demo_app/test/application_system_test_case.rb +5 -0
  100. data/examples/demo_app/test/channels/application_cable/connection_test.rb +11 -0
  101. data/examples/demo_app/test/controllers/.keep +0 -0
  102. data/examples/demo_app/test/controllers/home_controller_test.rb +7 -0
  103. data/examples/demo_app/test/fixtures/.keep +0 -0
  104. data/examples/demo_app/test/fixtures/files/.keep +0 -0
  105. data/examples/demo_app/test/helpers/.keep +0 -0
  106. data/examples/demo_app/test/integration/.keep +0 -0
  107. data/examples/demo_app/test/mailers/.keep +0 -0
  108. data/examples/demo_app/test/models/.keep +0 -0
  109. data/examples/demo_app/test/system/.keep +0 -0
  110. data/examples/demo_app/test/test_helper.rb +13 -0
  111. data/examples/demo_app/tmp/.keep +0 -0
  112. data/examples/demo_app/vendor/.keep +0 -0
  113. data/examples/demo_app/yarn.lock +7508 -0
  114. data/examples/normal_job.rb +39 -0
  115. data/jobi.gemspec +31 -0
  116. data/lib/jobi.rb +64 -0
  117. data/lib/jobi/clients/rabbitmq.rb +29 -0
  118. data/lib/jobi/config/rabbitmq.rb +58 -0
  119. data/lib/jobi/configuration.rb +66 -0
  120. data/lib/jobi/consumers/rabbitmq.rb +26 -0
  121. data/lib/jobi/job.rb +89 -0
  122. data/lib/jobi/message.rb +17 -0
  123. data/lib/jobi/runner.rb +25 -0
  124. data/lib/jobi/utils.rb +13 -0
  125. data/lib/jobi/version.rb +3 -0
  126. metadata +213 -0
@@ -0,0 +1 @@
1
+ ruby-2.7.0
@@ -0,0 +1,56 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ruby '2.7.0'
5
+
6
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
+ gem 'rails', '~> 6.0.0'
8
+ # Use sqlite3 as the database for Active Record
9
+ gem 'sqlite3', '~> 1.4'
10
+ # Use Puma as the app server
11
+ gem 'puma', '~> 3.11'
12
+ # Use SCSS for stylesheets
13
+ gem 'sass-rails', '~> 5'
14
+ # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
15
+ gem 'webpacker', '~> 4.0'
16
+ # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
17
+ gem 'turbolinks', '~> 5'
18
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
19
+ gem 'jbuilder', '~> 2.7'
20
+ # Use Redis adapter to run Action Cable in production
21
+ # gem 'redis', '~> 4.0'
22
+ # Use Active Model has_secure_password
23
+ # gem 'bcrypt', '~> 3.1.7'
24
+
25
+ # Use Active Storage variant
26
+ # gem 'image_processing', '~> 1.2'
27
+
28
+ # Reduces boot times through caching; required in config/boot.rb
29
+ gem 'bootsnap', '>= 1.4.2', require: false
30
+
31
+ group :development, :test do
32
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
33
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
34
+ end
35
+
36
+ group :development do
37
+ # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
38
+ gem 'web-console', '>= 3.3.0'
39
+ gem 'listen', '>= 3.0.5', '< 3.2'
40
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
41
+ gem 'spring'
42
+ gem 'spring-watcher-listen', '~> 2.0.0'
43
+ end
44
+
45
+ group :test do
46
+ # Adds support for Capybara system testing and selenium driver
47
+ gem 'capybara', '>= 2.15'
48
+ gem 'selenium-webdriver'
49
+ # Easy installation and use of web drivers to run system tests with browsers
50
+ gem 'webdrivers'
51
+ end
52
+
53
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
54
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
55
+
56
+ gem 'jobi', path: '../../'
@@ -0,0 +1,237 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ jobi (0.1.0)
5
+ bunny (>= 2.14.1)
6
+ logger
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (6.0.3.2)
12
+ actionpack (= 6.0.3.2)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (6.0.3.2)
16
+ actionpack (= 6.0.3.2)
17
+ activejob (= 6.0.3.2)
18
+ activerecord (= 6.0.3.2)
19
+ activestorage (= 6.0.3.2)
20
+ activesupport (= 6.0.3.2)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.0.3.2)
23
+ actionpack (= 6.0.3.2)
24
+ actionview (= 6.0.3.2)
25
+ activejob (= 6.0.3.2)
26
+ mail (~> 2.5, >= 2.5.4)
27
+ rails-dom-testing (~> 2.0)
28
+ actionpack (6.0.3.2)
29
+ actionview (= 6.0.3.2)
30
+ activesupport (= 6.0.3.2)
31
+ rack (~> 2.0, >= 2.0.8)
32
+ rack-test (>= 0.6.3)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
35
+ actiontext (6.0.3.2)
36
+ actionpack (= 6.0.3.2)
37
+ activerecord (= 6.0.3.2)
38
+ activestorage (= 6.0.3.2)
39
+ activesupport (= 6.0.3.2)
40
+ nokogiri (>= 1.8.5)
41
+ actionview (6.0.3.2)
42
+ activesupport (= 6.0.3.2)
43
+ builder (~> 3.1)
44
+ erubi (~> 1.4)
45
+ rails-dom-testing (~> 2.0)
46
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
47
+ activejob (6.0.3.2)
48
+ activesupport (= 6.0.3.2)
49
+ globalid (>= 0.3.6)
50
+ activemodel (6.0.3.2)
51
+ activesupport (= 6.0.3.2)
52
+ activerecord (6.0.3.2)
53
+ activemodel (= 6.0.3.2)
54
+ activesupport (= 6.0.3.2)
55
+ activestorage (6.0.3.2)
56
+ actionpack (= 6.0.3.2)
57
+ activejob (= 6.0.3.2)
58
+ activerecord (= 6.0.3.2)
59
+ marcel (~> 0.3.1)
60
+ activesupport (6.0.3.2)
61
+ concurrent-ruby (~> 1.0, >= 1.0.2)
62
+ i18n (>= 0.7, < 2)
63
+ minitest (~> 5.1)
64
+ tzinfo (~> 1.1)
65
+ zeitwerk (~> 2.2, >= 2.2.2)
66
+ addressable (2.7.0)
67
+ public_suffix (>= 2.0.2, < 5.0)
68
+ amq-protocol (2.3.2)
69
+ bindex (0.8.1)
70
+ bootsnap (1.4.7)
71
+ msgpack (~> 1.0)
72
+ builder (3.2.4)
73
+ bunny (2.15.0)
74
+ amq-protocol (~> 2.3, >= 2.3.1)
75
+ byebug (11.1.3)
76
+ capybara (3.33.0)
77
+ addressable
78
+ mini_mime (>= 0.1.3)
79
+ nokogiri (~> 1.8)
80
+ rack (>= 1.6.0)
81
+ rack-test (>= 0.6.3)
82
+ regexp_parser (~> 1.5)
83
+ xpath (~> 3.2)
84
+ childprocess (3.0.0)
85
+ concurrent-ruby (1.1.6)
86
+ crass (1.0.6)
87
+ erubi (1.9.0)
88
+ ffi (1.13.1)
89
+ globalid (0.4.2)
90
+ activesupport (>= 4.2.0)
91
+ i18n (1.8.5)
92
+ concurrent-ruby (~> 1.0)
93
+ jbuilder (2.10.0)
94
+ activesupport (>= 5.0.0)
95
+ listen (3.1.5)
96
+ rb-fsevent (~> 0.9, >= 0.9.4)
97
+ rb-inotify (~> 0.9, >= 0.9.7)
98
+ ruby_dep (~> 1.2)
99
+ logger (1.4.2)
100
+ loofah (2.6.0)
101
+ crass (~> 1.0.2)
102
+ nokogiri (>= 1.5.9)
103
+ mail (2.7.1)
104
+ mini_mime (>= 0.1.1)
105
+ marcel (0.3.3)
106
+ mimemagic (~> 0.3.2)
107
+ method_source (1.0.0)
108
+ mimemagic (0.3.5)
109
+ mini_mime (1.0.2)
110
+ mini_portile2 (2.4.0)
111
+ minitest (5.14.1)
112
+ msgpack (1.3.3)
113
+ nio4r (2.5.2)
114
+ nokogiri (1.10.10)
115
+ mini_portile2 (~> 2.4.0)
116
+ public_suffix (4.0.5)
117
+ puma (3.12.6)
118
+ rack (2.2.3)
119
+ rack-proxy (0.6.5)
120
+ rack
121
+ rack-test (1.1.0)
122
+ rack (>= 1.0, < 3)
123
+ rails (6.0.3.2)
124
+ actioncable (= 6.0.3.2)
125
+ actionmailbox (= 6.0.3.2)
126
+ actionmailer (= 6.0.3.2)
127
+ actionpack (= 6.0.3.2)
128
+ actiontext (= 6.0.3.2)
129
+ actionview (= 6.0.3.2)
130
+ activejob (= 6.0.3.2)
131
+ activemodel (= 6.0.3.2)
132
+ activerecord (= 6.0.3.2)
133
+ activestorage (= 6.0.3.2)
134
+ activesupport (= 6.0.3.2)
135
+ bundler (>= 1.3.0)
136
+ railties (= 6.0.3.2)
137
+ sprockets-rails (>= 2.0.0)
138
+ rails-dom-testing (2.0.3)
139
+ activesupport (>= 4.2.0)
140
+ nokogiri (>= 1.6)
141
+ rails-html-sanitizer (1.3.0)
142
+ loofah (~> 2.3)
143
+ railties (6.0.3.2)
144
+ actionpack (= 6.0.3.2)
145
+ activesupport (= 6.0.3.2)
146
+ method_source
147
+ rake (>= 0.8.7)
148
+ thor (>= 0.20.3, < 2.0)
149
+ rake (13.0.1)
150
+ rb-fsevent (0.10.4)
151
+ rb-inotify (0.10.1)
152
+ ffi (~> 1.0)
153
+ regexp_parser (1.7.1)
154
+ ruby_dep (1.5.0)
155
+ rubyzip (2.3.0)
156
+ sass (3.7.4)
157
+ sass-listen (~> 4.0.0)
158
+ sass-listen (4.0.0)
159
+ rb-fsevent (~> 0.9, >= 0.9.4)
160
+ rb-inotify (~> 0.9, >= 0.9.7)
161
+ sass-rails (5.1.0)
162
+ railties (>= 5.2.0)
163
+ sass (~> 3.1)
164
+ sprockets (>= 2.8, < 4.0)
165
+ sprockets-rails (>= 2.0, < 4.0)
166
+ tilt (>= 1.1, < 3)
167
+ selenium-webdriver (3.142.7)
168
+ childprocess (>= 0.5, < 4.0)
169
+ rubyzip (>= 1.2.2)
170
+ spring (2.1.0)
171
+ spring-watcher-listen (2.0.1)
172
+ listen (>= 2.7, < 4.0)
173
+ spring (>= 1.2, < 3.0)
174
+ sprockets (3.7.2)
175
+ concurrent-ruby (~> 1.0)
176
+ rack (> 1, < 3)
177
+ sprockets-rails (3.2.1)
178
+ actionpack (>= 4.0)
179
+ activesupport (>= 4.0)
180
+ sprockets (>= 3.0.0)
181
+ sqlite3 (1.4.2)
182
+ thor (1.0.1)
183
+ thread_safe (0.3.6)
184
+ tilt (2.0.10)
185
+ turbolinks (5.2.1)
186
+ turbolinks-source (~> 5.2)
187
+ turbolinks-source (5.2.0)
188
+ tzinfo (1.2.7)
189
+ thread_safe (~> 0.1)
190
+ web-console (4.0.4)
191
+ actionview (>= 6.0.0)
192
+ activemodel (>= 6.0.0)
193
+ bindex (>= 0.4.0)
194
+ railties (>= 6.0.0)
195
+ webdrivers (4.4.1)
196
+ nokogiri (~> 1.6)
197
+ rubyzip (>= 1.3.0)
198
+ selenium-webdriver (>= 3.0, < 4.0)
199
+ webpacker (4.2.2)
200
+ activesupport (>= 4.2)
201
+ rack-proxy (>= 0.6.1)
202
+ railties (>= 4.2)
203
+ websocket-driver (0.7.3)
204
+ websocket-extensions (>= 0.1.0)
205
+ websocket-extensions (0.1.5)
206
+ xpath (3.2.0)
207
+ nokogiri (~> 1.8)
208
+ zeitwerk (2.4.0)
209
+
210
+ PLATFORMS
211
+ ruby
212
+
213
+ DEPENDENCIES
214
+ bootsnap (>= 1.4.2)
215
+ byebug
216
+ capybara (>= 2.15)
217
+ jbuilder (~> 2.7)
218
+ jobi!
219
+ listen (>= 3.0.5, < 3.2)
220
+ puma (~> 3.11)
221
+ rails (~> 6.0.0)
222
+ sass-rails (~> 5)
223
+ selenium-webdriver
224
+ spring
225
+ spring-watcher-listen (~> 2.0.0)
226
+ sqlite3 (~> 1.4)
227
+ turbolinks (~> 5)
228
+ tzinfo-data
229
+ web-console (>= 3.3.0)
230
+ webdrivers
231
+ webpacker (~> 4.0)
232
+
233
+ RUBY VERSION
234
+ ruby 2.7.0p0
235
+
236
+ BUNDLED WITH
237
+ 2.1.2
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,2 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Home controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,6 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ CalculatorJob.run(number1: params[:number1], number2: params[:number2])
4
+ render json: {}, status: :ok
5
+ end
6
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module HomeHelper
2
+ end
@@ -0,0 +1,6 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
+
4
+ import { createConsumer } from "@rails/actioncable"
5
+
6
+ export default createConsumer()
@@ -0,0 +1,5 @@
1
+ // Load all the channels within this directory and all subdirectories.
2
+ // Channel files must be named *_channel.js.
3
+
4
+ const channels = require.context('.', true, /_channel\.js$/)
5
+ channels.keys().forEach(channels)
@@ -0,0 +1,17 @@
1
+ // This file is automatically compiled by Webpack, along with any other files
2
+ // present in this directory. You're encouraged to place your actual application logic in
3
+ // a relevant structure within app/javascript and only use these pack files to reference
4
+ // that code so it'll be compiled.
5
+
6
+ require("@rails/ujs").start()
7
+ require("turbolinks").start()
8
+ require("@rails/activestorage").start()
9
+ require("channels")
10
+
11
+
12
+ // Uncomment to copy all static images under ../images to the output folder and reference
13
+ // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
14
+ // or the `imagePath` JavaScript helper below.
15
+ //
16
+ // const images = require.context('../images', true)
17
+ // const imagePath = (name) => images(name, true)
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < Jobi::Job
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,14 @@
1
+ class CalculatorJob < ApplicationJob
2
+ options queue_name: :calculator,
3
+ ack: true,
4
+ consumers: 5
5
+
6
+ def initialize(number1:, number2:)
7
+ @number1 = number1
8
+ @number2 = number2
9
+ end
10
+
11
+ def run
12
+ @number1 + @number2
13
+ end
14
+ end