ambarltd / emulator

A local version of Ambar
2 stars 0 forks source link

Fix hanging issue #18

Closed lazamar closed 1 week ago

lazamar commented 1 week ago

We used an infinite cycling list to get the round-robin effect when one consumer reads from multiple partitions. But at some point we were trying to find a value that was not in the list. Big mistake. The value was never found. The list would never end. The program didn't allocate any memory. There was no error. And it didn't respond to anything because it was calculating something.

It was doing pretty much this:

$ ghci
> import Data.List
> find (== 3) (cycle [1, 2])

Fixes #12