Async API call example by goroutine and coroutine.
Tested with Go 1.16.15 & Java 11.
Go server uses Gin and Kotlin server uses Spring Boot.
Some API takes 5 second to process, and each server need to call the API for 10 times.
So, call it by async!
$ go run app.go
$ curl http://localhost:8800/api/v1/call-kotlin-server
# with no cap
$ curl http://localhost:8800/api/v1/call-kotlin-server-async
# with cap(2)
$ curl http://localhost:8800/api/v1/call-kotlin-server-async-dual
$ ./gradlew bootRun
$ curl http://localhost:8900/api/v1/call-go-server
# with no cap
$ curl http://localhost:8900/api/v1/call-go-server-async
# with cap(2)
$ curl http://localhost:8900/api/v1/call-go-server-async-dual