Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UW Advanced Rails Week 5
Search
Ben Woodall
April 30, 2015
Programming
0
52
UW Advanced Rails Week 5
Ben Woodall
April 30, 2015
Tweet
Share
More Decks by Ben Woodall
See All by Ben Woodall
UW Advanced Rails Week 9
benwoodall
0
37
UW Advanced Rails Week 8
benwoodall
0
46
UW Advanced Rails Week 7
benwoodall
0
43
Week 6
benwoodall
0
43
UW Advanced Rails Week 4
benwoodall
0
64
UW Advanced Rails Week 3
benwoodall
0
65
UW Advanced Rails Week 2
benwoodall
0
150
UW Advanced Rails Week 1
benwoodall
0
94
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
3
300
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
130
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
790
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
800
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
3
650
Effect の双対、Coeffect
yukikurage
5
1.4k
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
3
810
SODA - FACT BOOK
sodainc
1
1.1k
A comprehensive view of refactoring
marabesi
0
970
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
12
2.9k
イベントストーミングから始めるドメイン駆動設計
jgeem
4
870
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
51
8.4k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Balancing Empowerment & Direction
lara
1
350
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Code Review Best Practice
trishagee
68
18k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
Transcript
Questions from Week 4? 1
Week 5: Background Jobs Spring 2015 2
What are Background Jobs? 3
What are Background Jobs? Process that are run in the
background Independent from our Rails app 4
When should you use Background Jobs? 5
When should you use Background Jobs? 6
Long Running Requests/ Processes 7
Long Running Requests/ Processes HTTP requests outside of your app
Image/Video Processing 8
Tasks to be Run at a Later Date 9
Tasks to be Run at a Later Date Mailers Billing
Analytics Building Cleanup 10
How do Background Jobs Work? Queueing systems First In, First
Out (FIFO) 11
Active Job Introduced in Rails 4 Provides an interface for
queueing backends 12
Common Queueing Adapters Delayed Job github.com/collectiveidea/delayed_job Resque github.com/resque/resque Sidekiq http://sidekiq.org/
13
Delayed Job Pros Created by Shopify Very mature product. Well
maintained. Very simple to add, no external services Uses ActiveRecord for queueing 14
Delayed Job Cons Uses ActiveRecord for queueing Requires a separate
worker to check queues No Web-ui 15
Resque Pros Created by Github Well maintained. Asynchronous Doesn’t use
ActiveRecord Built in Web-ui Uses Redis 16
Resque Cons Harder to setup* Redis dependency 17
Sidekiq Pros Built in Web-ui Multi-threaded Uses Redis for queueing
18
Sidekiq Cons Harder to setup Redis dependency Thread Safety Not
Guaranteed! 19
Using Background Jobs in Shortener 20
Background Jobs Welcome Email Tweeting when creating links Weekly User
Stats 21
Adding sidekiq 22 Gemfile config/application.rb
Procfile with Foreman 23 Gemfile .foreman
Sidekiq Web View 24 Gemfile config/routes.rb
Sending Mail Later 25 app/controllers/users_controller.rb
Generate a Job 26
Twitter Job 27 app/controllers/links_controller.rb app/jobs/twitter_job.rb
Running Twitter Jobs 28 app/controllers/links_controller.rb
Failing Specs :( 29
30 specs/controllers/users_controller_spec.rb
31 app/controllers/links_controller_spec.rb
Cron Based Jobs 32 app/controllers/links_controller.rb config/schedule.rb
Cron Based Jobs 33 lib/tasks/email/weekly_tasks.rake