Adding Concurrency to our Web App – Go Lang Practical Programming Tutorial p.24

Welcome to part 24 of the Go Programming tutorial series. In this tutorial, we’re going to be applying goroutines and channels in an effort to add concurrency and more efficiency to our web app.

Text tutorials and sample code: https://pythonprogramming.net/go/
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://plus.google.com/+sentdex

Comments

Yt3912487 says:

great tutorial series!

We Rate Bikes says:

if you don’t load every page up front, will the Search field only find terms on that loaded page?

Ehsaan Asghar says:

Hi, im doing a project which involves coding using a raspberry pi. And i am outputin a cars data onto a screen which will help the driver, i was wondering if you could give me some tips and some help.
Would be much appreciated as this is my final project at university.
Thanks!

Abeltensor says:

The code is a little messy but the only way I can think of to actually increase performance would be to build this without using wait groups and to change the way the front end works.

So basically as far as the wait groups goes, you have this extra part that has to fire before the code starts to sync up, but you can naturally use go routines to handle syncing in 99% of cases if you write your code properly. Unfortunately, I don’t have the time right now to sit down and write a version with out wait groups, maybe later.

Also the template is unpacking the NewsAggPage struct which could be done better in the back end to get a little more speed.

Lets just say that If i was going to rewrite this code, I would probably use a map to store the incoming data and then I would be able to access that data directly with out having to iterate through it on the template.

Dark says:

Why do we have to wait for all goroutine until we can check the chanel? Normaly I would think, we only have to wait for the first routine to finish and then we can get the first chanel value. Could we sync this too? In theory the handeling of the data could cost expensive time and we would start some new goroutines with the handeling while some old goroutines are wating for the data to come in.

Sukhrab Ayupov says:

Do you have Data analysis (Pandas, Finance etc) tutorials in pdf format? I spend a good amount of time on the subway every day so would greatly appreciate to have something that I can access offline.

japrogramer says:

Since the weight group is global, wouldn’t you end up waiting for other requests to finish to send one if more than one happened before the wg was empty for previous request ?

9Y0 says:

6:52 you know how many locations you have since they are all stored in the s variable. isn’t it better to get te size of the locations and pass that number to the channel?

easyBob100 says:

For speed, I’d recommend loading the data once every minute or so on the back end. I don’t like the idea of loading the data from the WP every time a user visits your page….you’ll be making A LOT of requests to their site. This of course works even better for things that don’t change as fast either.

bajro lisić says:

Brother this channel become better and better I would like to see in future database manipulation (probably mongodb) and also websockets

George Grunwald says:

Thank you for all of these videos. This channel is full of useful information.

Tomas Evergardenas says:

Best tutorials on go lang! Thank you for these. I would love a tutorial about sql or nosql database. How to connect, fetch results and so on.

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours