-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
40 lines (31 loc) · 796 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"lets_go/concurrency_practice"
"lets_go/interface_practice/modules"
)
func main() {
//cmd.Main()
// learn_kafka.StartReading()
// learn_kafka.Produce()
//fast_http_example.StartServer()
//log.Logger.Info("main started...")
interPractice := modules.NewMainModule()
waitGroupPractice := concurrency_practice.NewWaitGroupPractice(interPractice)
var users []int
finished := make(chan bool)
for index := 0; index < 50000; index++ {
users = append(users, index)
}
var divided [][]int
for i := 0; i < len(users); i += 80 {
end := i + 80
if end > len(users) {
end = len(users)
}
divided = append(divided, users[i:end])
}
for _, chunkedUsers := range divided {
waitGroupPractice.RunPracticeWaitGroups(chunkedUsers, finished)
}
<-finished
}