#414 Batch API Requests pro
Here I demonstrate how to perform bulk API operations though a single request using Rack middleware. This is great if you need to trigger multiple actions at once such as if the user goes offline.
- Download:
- source code
- mp4
- m4v
- webm
- ogv
Thanks! I would really like to see more episodes on the "offline" subject.
He has! Search for "offline"
+1 !
The Staff Selection Commission (SSC) has finally released the admit cards for its upcoming Combined Graduate Level (CGL) Tier 1 examination 2017.Candidates who had registered for the examination can download their call letters from their official website, ssc.nic.in. SSC will conduct the CGL Tier-I exams from August 5th 2017 to August 24th 2017 at various centres across India.for recruitment to various positions that come under the Group ‘B’ and Group ‘C’ non-gazetted cadre in various Ministries/ Departments/ Organizations of the Government of India. Regarding the CGL tier 1 exam, it is an online test with objective type questions in the following subjects - General Intelligence and Reasoning, General Awareness, Quantitative Aptitude and English Comprehension. Qualifiers for tier I exam will be admitted for tier-II exam which is tentatively scheduled to be conducted on November 10 and 11, 2017. Steps to download SSC CGL Tier-I Admit Card 2017 - Visit the official website of SSC, ssc.nic.in or your respective state`s regional website of SSC. - Click on the link ‘download e-admission certificate’ or click here for eastern region , Kerala Karnataka Region, Southern Region , North Eastern Region , Western Region , Madhya Pradesh Region , Central Region , North Western Region , Northern Region - Enter the required details and follow the instructions on screen Remember to save the admit card and take it to the exam hall without fail, as entry is barred to candidates entering the venue without admit car
Of course I agree
Love this episode. Very useful stuff Ryan. Great to see the mechanics of this explained. It would also be cool to wrap this up into a gem. Almost seems like something that should be added to Rails core!
:+1: really enjoyed this episode.
Yeah it was really good !
+1 Good episode
+1 Its awesome
I love Too, nice share
I love Too, nice API
Anyone noticed strange artifacts between 5:13 and 5:50 mins when Ryan is explaining the Rack request variables (iTunes MP4 version)?
Same issue here
Aye, me too. (Chrome on Mac Lion)
Got the same issue with the 5:13 -> 5:50...
Hi Julius, thx, now it's runnung for me
Ryan,
You already use something like that in production? How about performance, may need to limit requests or something like that right?
First comment on railscasts, so here is the mandatory (and more than deserved) nicety : great job with this site!
Just a quick comment though that kept bugging me while watching this episode, since I'm a nitpicker. I don't like when the "else" is far from the "if", especially if the "if" is somewhat long. You could invert the condition here to make it easier to read. However, I also try to avoid 2-branches conditions when I can bail early. For example here, the first line could be "return @app.call(env) unless env["PATH_INFO"] == /batch", and you can then proceed with the rest of the function without the condition. General rule : when the first line of a method is an "if" and the last one closes that if you can always 1- avoid the 2 branches, 2 - both "branches" should be methods, if they are not simple one liners.
I guess there are many ways to refactor this, but that's the one I usually use :P To me it reads "proceed as normal, unless the path is /batch in which case, go on"
Sorry for the nitpicking on a very interesting episode
Very interesting episode, I'm just trying to implement this idea in my rails app to improve performance.
However Ryan's middleware fails if some of batch requests has status other than 200, e.g. 404:
this error comes from last line of 'process_request' method.
I changed that line to:
and it seems to work, but I'm not sure if this is bulletproof, so I will appreciate any thoughts on this
May be you should convert ActionDispath to Array or String.
I tried making it an array. It works. But It seems to be hacky. What exactly are we fixing?
Rack responses are not required to define
join
, onlyeach
. To ensure all responses are handled correctly by the middleware you can change it to:response_body = '' body.each{|bod| response_body << bod } response_body
Did Ryan do a railscast on building this javascript task list? If so, which one was it? Many thanks.
I don't believe Ryan has done one that focuses on just creating the to do list, but some good example of similar behaviour is when he was going through various javascript frameworks.
In Backbone.js
http://railscasts.com/episodes/323-backbone-on-rails-part-1
http://railscasts.com/episodes/325-backbone-on-rails-part-2
In Ember:
http://railscasts.com/episodes/408-ember-part-1
http://railscasts.com/episodes/410-ember-part-2
In AngularJS:
http://railscasts.com/episodes/405-angularjs
Search and tags will give you more suggestion.
Just for the record, I just found this gem:
https://github.com/arsduo/batch_api
Really nice!
This is a very interesting technique. I love seeing new ideas for how middleware can be used. This suites the online/offline problem very well. I didn't use this for my bulk/batch API personally because I needed to better tune performance, but I can see how this could be very useful. Thanks, Ryan.
What did you end up using if you don't mind me asking?
Interesting and useful episode, thanks!
Has anyone tried testing this with rspec
Hi,
I have a requirement of sending notifications weekly for my site https://wikigurus.com/ where i need to send emails to many users at a time. Can this Batch API applicable to send requests for bulk emails?. Will it give any performance improvement?
Thanks for sharing this great info with us as I am operating many of social sites pages like moviestarplanethacked.net and therefore I need of something that could help me to trigger multiple actions at the same time as it is quite time consuming to get things done one by one.
I really liked this information, it was really useful for implementing this on a wall decal webshop of one of my customers http://www.muurplakkers.nl
This is really very nice post you shared, i like the post, thanks for sharing
Thank you for this awesome information. It helps me a lot.
mind blowing
I really love to read such a nice article. Thanks!Keep rocking.
Shame to see so much spam in the comments here :(
cool
Very powerful !
Interesting post. I Have Been wondering about this issue, so thanks for posting.
Love your site, thanks.
Thank you very Steady info
sdfgdgdfg
Thanks guys, found a lot of useful information!
Thanks for it
Love your site, thanks.
Good Post
Thanks
Thanks for sharing this with us. I really liked this video.
Thanks for providing such a wonderful episode man
In the comments a lot of answers on the topic of routers, I'll advise you the best site on this topic
really
this nice good
“Way to go, girl. There is no one doing it better than you.”
It's great because of the knowledge you share with us, I will always follow your blog and will share your blog with my friends
Nice Video! Thank's for Sharing!
Thanks for the information
From now on, I will regularly visit this site because here gives me more useful information.
far cry 5 release date
Permainan TOGEL ONLINE , Live 24D,Live 48D Dan Dragon Tiger
Permainan Togel Ini Juga Tersedia Hadiah Utama, Hadiah Kedua, Dan Ada Juga Hadiah Ketiga Untuk 3D Dan 4D.
2D : Prize 1 X 70
3D : Prize 1 X 400, Prize 2 X 200, Prize 3 X 100
4D : Prize 1 X 3000, Prize 2 X 2000, Prize 3 X 1000
Ayuk Daftar Diri Anda Dan Bergabung Lah Bersama kami
Bonus Refferal 1% Seumur Hidup ( + Bonus hingga 100% )
Ayuk Buruan Daftar Diri Anda di Pokersemi
Kami Juga Menyediakan Berbagai Macam game Dalam 1 ID:
- Live Poker
- Poker
- Capsa
- Domino
- Ceme
- Ceme Keliling
HOT PROMO PokerSemi TERBARU..!!!
- BONUS DEPOSIT NEW MEMBER
- BONUS DEPOSIT SETIAP HARI
- BONUS TURN OVER 0,5%
- BONUS REFERRAL 20%
- BONUS EVENT LUCKY DRAW MINGGUAN...!!!
- PROGESSIVE JACKPOT : 875,084,902
Info Lebih Lengkap Cek Disini bos..
Banyak Juga Jackpot Yang Akan Menanti Anda
Kami Juga Akan Memberikan Bonus Seperti :
- Bonus Turnover 0,3%
- Bonus Refferal 20% Seumur Hidup
- Bonus Deposit New Member IDR 10.000
- Bonus Deposit Setiap Hari IDR 5.000
- Bonus Event Lucky Draw Mingguan IDR 300.000
Salam Dari Admin Poker Semi
Ayuk Buruan Daftar Diri Anda di ARMANI POKER
Kami Juga Menyediakan Berbagai Macam game Dalam 1 ID:
- Live Poker
- Poker
- Capsa
- Domino
- Ceme
- Ceme Keliling
HOT PROMO ArmaniPoker TERBARU..!!!
- BONUS DEPOSIT NEW MEMBER
- BONUS DEPOSIT SETIAP HARI
- BONUS TURN OVER 0,3%
- BONUS REFERRAL 20%
- BONUS EVENT LUCKY DRAW MINGGUAN...!!!
- PROGESSIVE JACKPOT : 875,084,902
Banyak Juga Jackpot Yang Akan Menanti Anda
nicw
nice thanks for provide good information.
Awesome post. Thanks for sharing.
awesme dudue