Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/Go Lang/Go Structure/goroutine/
goroutine usage
Loading views...
Search

goroutine usage

go keyword가 async같이 <- await
package main import ( "fmt" "time" ) func f(from string) { for i := 0; i < 3; i++ { fmt.Println(from, ":", i) } } func main() { f("direct") go f("goroutine") go func(msg string) { fmt.Println(msg) }("going") fmt.Println("done") time.Sleep(time.Second) }
The await/async concurrency pattern in Golang
First of all...happy new year! I decided after a while to come back online speaking about Golang. In this post, I will focus on parallelism and concurrency and how you can achieve the same behavioral pattern you can achieve with Node.js using await/async statements, without the difficulties (hopefully) of dealing with Single Threaded Event Loop and these primitives (that, btw, keep things really simple).
The await/async concurrency pattern in Golang
https://madeddu.xyz/posts/go-async-await/
The await/async concurrency pattern in Golang
 
 

Recommendations

Texonom
Texonom
/
Engineering
Engineering
/Software Engineering/Programming/Programming Language/Programming Languages/4GL/Go Lang/Go Structure/goroutine/
goroutine usage
Copyright Seonglae Cho