2 Commits

Author SHA1 Message Date
K
c91e7b9765
using testify instead of testing.T methods. (#143) 2024-09-09 07:20:56 -03:00
fiatjaf
5938a71146 replace close() with actually sending a value to .EndOfStoredEvents and .Closed channels.
I thought `close()` would be nice because it would be cheap and not lock the goroutine while waiting for the receiver to acknowledge the thing, but turns out it introduces the serious risk of users putting <- sub.EndOfStoredEvents in the same for { select {} } statement as sub.Events, for example, and they they get into an infinite loop.

we had this same problem here inside this same library, and what is fixed in 242af0bf76e4b23de47012244efb95ccec9e4374 by @mattn.
2024-01-01 10:18:16 -03:00