getMessages gets a slice of messages to process
()
| 30 | |
| 31 | // getMessages gets a slice of messages to process |
| 32 | func getMessages() []string { |
| 33 | file, _ := os.ReadFile("datums/melville-moby_dick.txt") |
| 34 | words := strings.Split(string(file), " ") |
| 35 | return words |
| 36 | } |
| 37 | |
| 38 | // this will block and not close if the len(msgs) is larger than the channel buffer. |
| 39 | func (wp *workerPool) queueMessages() { |