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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ben Woodall
April 30, 2015
Programming
0
57
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
44
UW Advanced Rails Week 8
benwoodall
0
51
UW Advanced Rails Week 7
benwoodall
0
47
Week 6
benwoodall
0
51
UW Advanced Rails Week 4
benwoodall
0
71
UW Advanced Rails Week 3
benwoodall
0
70
UW Advanced Rails Week 2
benwoodall
0
190
UW Advanced Rails Week 1
benwoodall
0
100
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
150
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.6k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
180
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1k
CSC307 Lecture 11
javiergs
PRO
0
590
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
130
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
4
380
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.4k
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
AI活用のコスパを最大化する方法
ochtum
0
120
浮動小数の比較について
kishikawakatsumi
0
380
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
300
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Six Lessons from altMBA
skipperchong
29
4.2k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
240
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
80
Statistics for Hackers
jakevdp
799
230k
We Are The Robots
honzajavorek
0
190
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
100
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