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
67
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
48
UW Advanced Rails Week 8
benwoodall
0
58
UW Advanced Rails Week 7
benwoodall
0
55
Week 6
benwoodall
0
61
UW Advanced Rails Week 4
benwoodall
0
78
UW Advanced Rails Week 3
benwoodall
0
78
UW Advanced Rails Week 2
benwoodall
0
210
UW Advanced Rails Week 1
benwoodall
0
110
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
260
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
400
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
230
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
540
net-httpのHTTP/2対応について
naruse
0
490
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
140
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.2k
AIで効率化できた業務・日常
ochtum
0
140
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
600
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Believing is Seeing
oripsolob
1
150
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Are puppies a ranking factor?
jonoalderson
1
3.6k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
It's Worth the Effort
3n
188
29k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
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