Skip to content

Commit 075029e

Browse files
committed
Add suckerpunch, in memory queue
1 parent ea224bc commit 075029e

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ gem 'ranked-model'
3434
gem 'staccato'
3535

3636
gem "rails-settings-cached"
37+
gem 'sucker_punch', '~> 2.0'
3738

3839
# Auth Gems
3940
gem 'devise'

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ GEM
422422
activesupport (>= 4.0)
423423
sprockets (>= 3.0.0)
424424
staccato (0.4.5)
425+
sucker_punch (2.0.1)
426+
concurrent-ruby (~> 1.0.0)
425427
temple (0.7.6)
426428
terminal-table (1.5.2)
427429
thor (0.19.1)
@@ -540,6 +542,7 @@ DEPENDENCIES
540542
shoulda
541543
spring (~> 1.4.0)
542544
staccato
545+
sucker_punch (~> 2.0)
543546
timecop
544547
trix
545548
turbolinks

config/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Application < Rails::Application
2828

2929
# We are using active_job and currently the inline backend. You may change this if
3030
# you want a more robust solution. The queue is used for emails.
31-
# config.active_job.queue_adapter = your_adapter_here
31+
config.active_job.queue_adapter = :sucker_punch
3232

3333
end
3434
end

config/initializers/sucker_punch.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# config/initializers/sucker_punch.rb
2+
3+
require 'sucker_punch/async_syntax'

test/test_helper.rb

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
require File.expand_path('../../config/environment', __FILE__)
55
require 'rails/test_help'
66

7+
# Requiring this library causes your jobs to run everything inline. So a call to the following
8+
# will actually be SYNCHRONOUS
9+
require 'sucker_punch/testing/inline'
10+
711
class ActiveSupport::TestCase
812
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
913
fixtures :all

0 commit comments

Comments
 (0)