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
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
49
UW Advanced Rails Week 8
benwoodall
0
60
UW Advanced Rails Week 7
benwoodall
0
56
Week 6
benwoodall
0
63
UW Advanced Rails Week 4
benwoodall
0
79
UW Advanced Rails Week 3
benwoodall
0
79
UW Advanced Rails Week 2
benwoodall
0
220
UW Advanced Rails Week 1
benwoodall
0
110
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
710
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
160
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
2.8k
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
240
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
810
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.3k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
130
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
7
3.2k
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
symfony/aiとlaravel/boost
77web
0
120
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
350
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
310
Exploring anti-patterns in Rails
aemeredith
3
440
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
180
Building Adaptive Systems
keathley
44
3.1k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Building Applications with DynamoDB
mza
96
7.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
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