-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
48 lines (37 loc) · 886 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
41
42
43
44
45
46
47
48
package main
import (
"log"
"sync"
"github.com/ayushthe1/streak/chatbot"
"github.com/ayushthe1/streak/database"
"github.com/ayushthe1/streak/httpserver"
"github.com/ayushthe1/streak/kafka"
"github.com/ayushthe1/streak/ws"
)
func main() {
database.Connect()
var wg sync.WaitGroup
wg.Add(3)
go func() {
// Decrement the counter when this goroutine completes
defer wg.Done()
ws.StartWebSocketServer()
}()
go func() {
// Decrement the counter when this goroutine completes
defer wg.Done()
httpserver.StartHttpServer()
}()
go func() {
defer wg.Done()
kafka.StartKafkaConsumer()
}()
go chatbot.CreateChatBotUser()
// go func() {
// defer wg.Done()
// upload.SetupFileUpload()
// }()
// Wait for both goroutines to complete
wg.Wait()
log.Println("Both servers , kafka, fileUploadConsumer have been started and are running concurrently.")
}