Skip to content

Commit

Permalink
Revert dispatcher chan size
Browse files Browse the repository at this point in the history
  • Loading branch information
alitto committed Nov 11, 2024
1 parent e2afebe commit 6918640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewDispatcher[T any](ctx context.Context, dispatchFunc func([]T), batchSize
dispatcher := &Dispatcher[T]{
ctx: ctx,
buffer: linkedbuffer.NewLinkedBuffer[T](10, batchSize),
bufferHasElements: make(chan struct{}, 2), // This channel needs to have size 2 in case an element is written to the buffer while the dispatcher is processing elements
bufferHasElements: make(chan struct{}, 1), // This channel needs to have size 2 in case an element is written to the buffer while the dispatcher is processing elements
dispatchFunc: dispatchFunc,
batchSize: batchSize,
}
Expand Down

0 comments on commit 6918640

Please sign in to comment.