github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/gossip/protocols/blockvotes/bvprocessor/config.go (about) 1 package bvprocessor 2 3 import ( 4 "time" 5 6 "github.com/syndtr/goleveldb/leveldb/opt" 7 8 "github.com/unicornultrafoundation/go-helios/native/dag" 9 "github.com/unicornultrafoundation/go-helios/utils/cachescale" 10 ) 11 12 type Config struct { 13 BufferLimit dag.Metric 14 15 SemaphoreTimeout time.Duration 16 17 MaxTasks int 18 } 19 20 func DefaultConfig(scale cachescale.Func) Config { 21 return Config{ 22 BufferLimit: dag.Metric{ 23 Num: 3000, 24 Size: scale.U64(15 * opt.MiB), 25 }, 26 SemaphoreTimeout: 10 * time.Second, 27 MaxTasks: 512, 28 } 29 }