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
47
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
34
UW Advanced Rails Week 8
benwoodall
0
42
UW Advanced Rails Week 7
benwoodall
0
40
Week 6
benwoodall
0
40
UW Advanced Rails Week 4
benwoodall
0
60
UW Advanced Rails Week 3
benwoodall
0
63
UW Advanced Rails Week 2
benwoodall
0
87
UW Advanced Rails Week 1
benwoodall
0
93
A Bit More Git
benwoodall
1
5k
Other Decks in Programming
See All in Programming
Ruby Function Composition
bkuhlmann
1
340
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
200
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
7
1.2k
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
260
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
990
Hanami and htmx
bkuhlmann
0
210
GitHub Copilotのススメ
marcy731
1
210
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1.1k
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
510
Sheets API使ってみた
toshi0383
2
140
Code Reviews
bkuhlmann
4
890
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
370
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Building a Scalable Design System with Sketch
lauravandoore
457
32k
Atom: Resistance is Futile
akmur
260
25k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
63
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
KATA
mclloyd
16
12k
Debugging Ruby Performance
tmm1
70
11k
The Pragmatic Product Professional
lauravandoore
26
5.8k
What's in a price? How to price your products and services
michaelherold
238
11k
Adopting Sorbet at Scale
ufuk
69
8.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Building an army of robots
kneath
300
41k
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