stoewer/go-nakadi

stream number incorrectly passed to NotifyOK and NotifyErr functions

Closed this issue · 0 comments

krnkl commented

When creating stream options stream index is not properly passed to notify functions. Closure should be created here for the index:

for i := uint(0); i < options.StreamCount; i++ {
   ...
   CommitMaxElapsedTime: options.CommitMaxElapsedTime,
	NotifyErr:            func(err error, duration time.Duration) { options.NotifyErr(i, err, duration) },
	NotifyOK:             func() { options.NotifyOK(i) }}
...