Skip to content

Commit

Permalink
revert initial linkedbuffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
alitto committed Nov 11, 2024
1 parent f8fc03f commit 7eb6908
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 @@ -27,7 +27,7 @@ type Dispatcher[T any] struct {
func NewDispatcher[T any](ctx context.Context, dispatchFunc func([]T), batchSize int) *Dispatcher[T] {
dispatcher := &Dispatcher[T]{
ctx: ctx,
buffer: linkedbuffer.NewLinkedBuffer[T](1, batchSize),
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
dispatchFunc: dispatchFunc,
batchSize: batchSize,
Expand Down

0 comments on commit 7eb6908

Please sign in to comment.