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
60
0
Share
UW Advanced Rails Week 5
Ben Woodall
April 30, 2015
More Decks by Ben Woodall
See All by Ben Woodall
UW Advanced Rails Week 9
benwoodall
0
47
UW Advanced Rails Week 8
benwoodall
0
53
UW Advanced Rails Week 7
benwoodall
0
50
Week 6
benwoodall
0
53
UW Advanced Rails Week 4
benwoodall
0
72
UW Advanced Rails Week 3
benwoodall
0
72
UW Advanced Rails Week 2
benwoodall
0
200
UW Advanced Rails Week 1
benwoodall
0
100
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
1
300
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
Don't Prompt Harder, Structure Better
kitasuke
0
750
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
2
110
How Swift's Type System Guides AI Agents
koher
0
250
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
130
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
170
AIエージェントで業務改善してみた
taku271
0
520
의존성 주입과 모듈화
fornewid
0
130
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
140
ファインチューニングせずメインコンペを解く方法
pokutuna
0
310
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
330
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Documentation Writing (for coders)
carmenintech
77
5.3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
180
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
500
AI: The stuff that nobody shows you
jnunemaker
PRO
6
570
Code Reviewing Like a Champion
maltzj
528
40k
Tell your own story through comics
letsgokoyo
1
890
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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