Ben Kochie
Ben Kochie
The only way for this to be sensible is if we implement per-packet timeouts. With the current implementation, we have an unlimited amount of time that we could wait for...
This needs a DCO sign-off. You can use `git commit -s --amend` to add it.
If someone would like to fork this code and submit a new PR, feel free.
This is similar to the work I was doing in https://github.com/prometheus-community/pro-bing/pull/9. One thing tho, you're not doing any locking, so this is not going to be thread safe as-is.
There's no way to predict how this might be used later. Any time you make code that updates a shards struct like this, better safe than sorry.
Yes, exactly, `Next()`, `Retire()`, and `RemoveAfterMaxItems()` are public API functions. They need locking protection if they mutate the state.
Sorry, I've been traveling and have a bit of a review backlog.
`pinger.OnRecv()` returns the packet, and `pinger.OnRecvError()` handlers return the packet and packet failure info. Can you be more specific about what's missing?
As a library, I prefer that we have a logging hook that is compatible with the stdlib logger.
There's now https://pkg.go.dev/golang.org/x/exp/slog, which is supposed to be in 1.21 stdlib.