We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b7d634 commit 62b8ab7Copy full SHA for 62b8ab7
provider/reprovider.go
@@ -183,6 +183,17 @@ func DatastorePrefix(k datastore.Key) Option {
183
}
184
185
186
+// MaxBatchSize limit how big each batch is.
187
+// Some content routers like acceleratedDHTClient have sub linear scalling and
188
+// bigger sizes are thus faster per elements however smaller batch sizes can
189
+// limit memory usage spike.
190
+func MaxBatchSize(n uint) Option {
191
+ return func(system *reprovider) error {
192
+ system.maxReprovideBatchSize = n
193
+ return nil
194
+ }
195
+}
196
+
197
// ThroughputReport will fire the callback synchronously once at least limit
198
// multihashes have been advertised, it will then wait until a new set of at least
199
// limit multihashes has been advertised.
0 commit comments