Created
June 11, 2020 09:13
-
-
Save velotiotech/7582b1311b781e2f26421db1e6e11df8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function performs the given task concurrently by spawing a goroutine | |
// for each of those tasks. | |
func performAsyncTasks(task []Task) { | |
for _, task := range tasks { | |
// This will spawn a separate goroutine to carry out this task. | |
// This call is non-blocking | |
go task.Execute() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment