Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 11, 2020 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/7582b1311b781e2f26421db1e6e11df8 to your computer and use it in GitHub Desktop.
Save velotiotech/7582b1311b781e2f26421db1e6e11df8 to your computer and use it in GitHub Desktop.
// 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