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
73
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
54
UW Advanced Rails Week 8
benwoodall
0
64
UW Advanced Rails Week 7
benwoodall
0
60
Week 6
benwoodall
0
67
UW Advanced Rails Week 4
benwoodall
0
81
UW Advanced Rails Week 3
benwoodall
0
81
UW Advanced Rails Week 2
benwoodall
0
230
UW Advanced Rails Week 1
benwoodall
0
110
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
初めての模倣学習とVLA
natsutan
0
170
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
7
2.1k
React本体のコードリーディング
high_g_engineer
1
150
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
250
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
690
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
100
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
510
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
260
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
360
Dockerfile CMD for Node.js
grazie1999
0
110
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
120
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
230
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
24k
Rails Girls Zürich Keynote
gr2m
96
14k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Done Done
chrislema
186
16k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
210
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Being A Developer After 40
akosma
91
590k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
570
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
900
Navigating Weather and Climate Data
rabernat
0
490
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