Open Sytten opened 5 years ago
Kinsumer is designed to be called from a single go routine, so you shouldn't have to call Stop()
on a stopped consumer. That said, can you describe your use case some more, maybe I can update the library to handle your use case.
The lib doesn't accept a Context
, so it is somewhat hard to do a graceful shutdown. I ended up doing this:
go func() {
select {
case <-ctx.Done():
k.Stop()
}
}()
But I also had a defer k.Stop()
and it was blocking the shutdown.
I guess the best way to fix this problem would be to accept a context so we can cancel the job.
The title says pretty much all. The fix is not obvious though since it is using a blocking channel internally.