Zenler Player
Your course is loading. Hang tight.
Working with Concurrency in Go (Golang)
Back to curriculum
0% Complete
0% Complete
Introduction
Installing Go
Installing Visual Studio Code
Installing Make
Asking for help
Mistakes. We all make them.
What we'll cover in this section
Creating GoRoutines and identifying a problem
WaitGroups to the rescue
Writing tests with WaitGroups
Challenge: working with WaitGroups
Solution to Challenge
What we'll cover in this section
Race Conditions: an example
Adding sync.Mutex to our code
Testing for race conditions
A more complex example
Writing a test for our weekly income project
Producer/Consumer - Using Channels for the first time
Getting started with the Producer - the pizzeria function
Making a pizza: the makePizza function
Finishing up the Producer code
Creating and running the consumer: ordering a pizza
Finishing up our Producer/Consumer project
What we'll cover in this section
Getting started with the problem
Implementing the diningProblem logic
Challenge: Printing out the order in which the meal is finished
Solution to challenge
Writing a test for our program
What we'll cover in this section
Introduction to channels
The select statement
Buffered Channels
Getting started with the Sleeping Barber project
Defining some variables, the barber shop, and getting started with the code
Adding a Barber
Starting the barbershop as a GoRoutine
Sending clients to the shop
Trying things out
What we'll cover in this section
Setting up a simple web application
Setting up our Docker development environment
Adding postgres
Setting up a Makefile
Adding sessions & Redis
Setting up the application config
Setting up a route & handler for the home page, and starting the web server
Setting up templates and building a render function
Adding session middleware
Setting up additional stub handlers and routes
Implementing graceful shutdown
Populating the database
Adding a data package and database models
Implementing the login/logout functions
What we'll cover in this section
Getting started with the mailer code
Building HTML and Plain Text messages
Sending a message (synchronously)
Getting started sending a message (asynchronously)
Writing a helper function to send email easily
Sending an email on incorrect login
Adding cleanup tasks to the shutdown() function
What we'll cover in this section
Adding mail templates and URL signer code
Starting on the handler to create a user
Activating a user
Giving user data to our templates
Displaying the Subscription Plans page
Adding a route and trying things out for the "Plans" page
Writing a stub handler for choosing a plan
What we'll cover in this section
Getting the plan id, the plan, and the user
Generating an Invoice
Generating a manual
Trying things out, subscribing a user, updating the session, and redirecting
What we'll cover in this section
Setting up our tests
Testing Routes
Testing the Renderer
Modifying the data package to make it testable
Implementing the PlanTest type
Getting started testing Handlers
Testing the Login Handler
Testing a handler that uses concurrency
Introduction
Introduction
Preview
Installing Go
Preview
Installing Visual Studio Code
Installing Make
Asking for help
Mistakes. We all make them.
Goroutines, the go keyword, and WaitGroups
What we'll cover in this section
Preview
Creating GoRoutines and identifying a problem
Preview
WaitGroups to the rescue
Writing tests with WaitGroups
Challenge: working with WaitGroups
Solution to Challenge
Race Conditions, Mutexes, and an Introduction to Channels
What we'll cover in this section
Preview
Race Conditions: an example
Preview
Adding sync.Mutex to our code
Testing for race conditions
A more complex example
Writing a test for our weekly income project
Producer/Consumer - Using Channels for the first time
Getting started with the Producer - the pizzeria function
Making a pizza: the makePizza function
Finishing up the Producer code
Creating and running the consumer: ordering a pizza
Finishing up our Producer/Consumer project
A Classic Problem: The Dining Philosophers
What we'll cover in this section
Preview
Getting started with the problem
Implementing the diningProblem logic
Challenge: Printing out the order in which the meal is finished
Solution to challenge
Writing a test for our program
Channels and another classic: The Sleeping Barber problem
What we'll cover in this section
Preview
Introduction to channels
Preview
The select statement
Buffered Channels
Getting started with the Sleeping Barber project
Defining some variables, the barber shop, and getting started with the code
Adding a Barber
Starting the barbershop as a GoRoutine
Sending clients to the shop
Trying things out
Final Project: Building a Subscription Service
What we'll cover in this section
Preview
Setting up a simple web application
Setting up our Docker development environment
Adding postgres
Setting up a Makefile
Adding sessions & Redis
Setting up the application config
Setting up a route & handler for the home page, and starting the web server
Setting up templates and building a render function
Adding session middleware
Setting up additional stub handlers and routes
Implementing graceful shutdown
Populating the database
Adding a data package and database models
Implementing the login/logout functions
Sending Mail Concurrently
What we'll cover in this section
Preview
Getting started with the mailer code
Building HTML and Plain Text messages
Sending a message (synchronously)
Getting started sending a message (asynchronously)
Writing a helper function to send email easily
Sending an email on incorrect login
Adding cleanup tasks to the shutdown() function
Registering a User and Displaying Plans
What we'll cover in this section
Preview
Adding mail templates and URL signer code
Starting on the handler to create a user
Activating a user
Giving user data to our templates
Displaying the Subscription Plans page
Adding a route and trying things out for the "Plans" page
Writing a stub handler for choosing a plan
Adding Concurrency to Choosing a Plan
What we'll cover in this section
Preview
Getting the plan id, the plan, and the user
Generating an Invoice
Generating a manual
Trying things out, subscribing a user, updating the session, and redirecting
Testing
What we'll cover in this section
Preview
Setting up our tests
Preview
Testing Routes
Testing the Renderer
Modifying the data package to make it testable
Implementing the PlanTest type
Getting started testing Handlers
Testing the Login Handler
Testing a handler that uses concurrency
×
This is an unpublished lesson. This lesson will not be shown for students unless you set it as Public.
Back to Dashboard
No contents are available in this lesson!
No lessons available !
Back to Dashboard
Lesson contents locked
Enroll to unlock this lesson.
Enroll to unlock
Next Lesson