Skip to content

Commit

Permalink
fixing go channeling
Browse files Browse the repository at this point in the history
  • Loading branch information
STollenaar committed Sep 24, 2023
1 parent 14d0954 commit 068da73
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions internal/sqspoller/sqspoller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,18 @@ func init() {

func PollSQS() {
for {
select {
case <-sqsObjectChannel:
sqsObject := <-sqsObjectChannel
fmt.Printf("Handling object %v\n", sqsObject)
switch sqsObject.Type {
case "url":
handleURLObject(sqsObject)
case "user":
handleUserObject(sqsObject)
default:
fmt.Printf("Unknown type has been send to queue. sqsObject is: %v", sqsObject)
}

sqsObject := <-sqsObjectChannel
fmt.Printf("Handling object %v\n", sqsObject)
switch sqsObject.Type {
case "url":
handleURLObject(sqsObject)
case "user":
handleUserObject(sqsObject)
default:
fmt.Printf("Unknown type has been send to queue. sqsObject is: %v", sqsObject)
}
}

}

func pollSQS() {
Expand Down

0 comments on commit 068da73

Please sign in to comment.