a2f8605c66
Move the subscription context to Next. context.Context should generally never be stored in a struct because it makes that struct only valid while the context is valid. This is rarely obvious from the caller. Adds a forceClosed channel in place of the old context, and uses the new context as a way for the caller to stop the Subscription blocking. Remove some recursion out of bufferImte.Next. The caller is already looping so we can continue in that loop instead of recursing. This ensures currentItem is updated immediately (which probably does not matter in practice), and also removes the chance that we overflow the stack. NextNoBlock and FollowAfter do not need to handle bufferItem.Err, the caller already handles it. Moves filter to a method to simplify Next, and more explicitly separate filtering from looping. Also improve some godoc Only unwrap itemBuffer.Err when necessary |
||
---|---|---|
.. | ||
event.go | ||
event_buffer.go | ||
event_buffer_test.go | ||
event_publisher.go | ||
event_publisher_test.go | ||
event_snapshot.go | ||
event_snapshot_test.go | ||
event_test.go | ||
subscription.go | ||
subscription_test.go |