Skip to content

Commit

Permalink
blockstream: add Buffer option for NewUnmanaged constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Nov 15, 2022
1 parent 5c4ec70 commit 752234e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blockstream/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ func ServerOptionWithLogger(logger *zap.Logger) ServerOption {
}
}

func ServerOptionWithBuffer(size int) ServerOption {
return func(s *Server) {
s.buffer = bstream.NewBuffer("blockserver", s.logger.Named("buffer"))
s.bufferSize = size
}
}

type Server struct {
headInfo *headInfo
buffer *bstream.Buffer
Expand Down

0 comments on commit 752234e

Please sign in to comment.