-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (25 loc) · 783 Bytes
/
main.go
File metadata and controls
33 lines (25 loc) · 783 Bytes
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
package main
import (
"fmt"
"log"
"os"
"strings"
"github.com/jellyfishphp/event-queue-worker/internal/event"
"github.com/jellyfishphp/event-queue-worker/internal/worker"
)
func main() {
jellyfishApplicationDir, error := os.Getwd()
if error != nil {
log.Fatal(error)
}
if len(os.Args) == 2 {
jellyfishApplicationDir = os.Args[1]
}
pathToConsoleApp := fmt.Sprintf("%s/vendor/bin/console", strings.TrimRight(jellyfishApplicationDir, "/"))
listenerReader := event.NewListenerReader(pathToConsoleApp)
listeners := listenerReader.GetAll()
listenerConverter := event.NewListenerConverter(pathToConsoleApp)
processes := listenerConverter.ConvertMultipleToProcesses(listeners)
eventQueueWorker := worker.NewEventQueueWorker(processes)
eventQueueWorker.Start()
}